Timestamp quickies

To get the current timestamp on your linux machine  (oddly has some problem on my customized zsh shell. works fine on bash)

date +%s

To convert timestamp to date format on your linux machine

date -d @

Date to timestamp is

date -d “Dec 21, 2011 22:00:01” +%s

and for heaven’s sake when you are using UNIX_TIMESTAMP() function in mysql, please take care about your TZ difference between your OS and mysql.


Timestamp quickies


December 02, 2011

Find me on Twitter @sandeepssrin

Did i make any mistake? Please consider sending a pull request.