Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: MySQL, UNIX_TIMESTAMP() and Perl's time()

by gmax (Abbot)
on May 16, 2003 at 15:21 UTC ( [id://258683]=note: print w/replies, xml ) Need Help??


in reply to MySQL, UNIX_TIMESTAMP() and Perl's time()

Perl's time() function and MySQL's UNIX_TIMESTAMP() function seem to have completely different ideas about what time it is

Actually, they don't. The epoch from where time is calculated is January 1, 1970 for both MySQL and Perl, unless you happen to use a Mac OS, where the epoch is January 1, 1904.

$ perl -e 'print time(), "\n";' ; mysql -e "select unix_timestamp()" 1053097150 +------------------+ | unix_timestamp() | +------------------+ | 1053097150 | +------------------+

See also Perl's time and MySQL's timestamp for more about this issue.

_ _ _ _ (_|| | |(_|>< _|

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://258683]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-25 17:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found