On Linux you can convert a date like "2010-10-02" to a unix timestamp in shell script by
date -d "2010-10-02" "+%s"
Since Mac OS does not have the equivalent -d for date. How do you go about converting a date to a unix timestamp in a shell script.
To easily convert UNIX timestamp to date in the . csv file, do the following: 1. =R2/86400000+DATE(1970,1,1), press Enter key.
Use the build-in date command and instruct it to output the number of seconds since 1970-01-01 00:00:00 UTC. You can do this by passing a format string as parameter to the date command. The format string for UNIX epoch time is '%s'. To convert a specific date and time into UNIX epoch time, use the -d parameter.
date +%s
This works fine for me on OS X Lion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With