I'm here for a conversion issue.

I have a perl program that gets the uptime of a router, and the output is like :

 "0000/8/17 1:50:0"

where : - 0000 --> Year of uptime - 8 --> Month of uptime - 17 --> Days of uptime and so on... (hh:mm:ss)

I made this to match the Mysql TIMESTAMP format. But actually, Mysql don't want year under 1967 and over 2037 (don't know why) When i'm adding this to my database, the result is 0000-00-00 00:00:00 because of the year

Isn't there anything that we can to get a year under 1967 with mysql ? (year 0, year 1...)

有帮助吗?

解决方案

Datetime can accept date under 1970. I just have to convert timestamp as datetime. I guess there's nothing much difference but this.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top