This workflow performs the following functions: - Get current timestamp. - Convert a timestamp to DATETIME format. - Convert a string date to timestamp.
Use the 'ts' command followed by your conversion request. You can use a unix timestamp or any string that could be parsed by the php function strtotime (http://php.net/manual/en/function.strtotime.php)
"ts" Returns current timestamp in seconds.
"ts 1363975708" Returns "2013-03-22 02:08:28"
"ts tomorrow" "ts 1 year ago" "ts next thursday" Returns timestamp for the given day at 12 am
INFO ABOUT PHP TIMEZONE:
This workflow uses PHP, so it will return whatever default timezone is set on your php.ini. PHP errors are suppressed here due to a tendency for Macs to produce a warning that you need to set your PHP default timezone.
If you are getting results not in your timezone, you should set the date.timezone in your Mac's php.ini file, usually found at /etc/php.ini.default.
If you use, for example PHP installed via homebrew, you normally will find your php.ini at /usr/local/etc/php//php.ini).
You also can try
php -i | grep "Loaded Configuration File" to get the path to your active/loaded PHP configuration file.