How can I generate Unix timestamps?
in Ruby:
>> Time.now.to_i
=> 1248933648
In Linux or MacOS you can use:
date +%s
where
+%s
, seconds since 1970-01-01 00:00:00 UTC. (GNU Coreutils 8.24 Date manual)
Example output now 1454000043.
in Ruby:
>> Time.now.to_i
=> 1248933648
In Linux or MacOS you can use:
date +%s
where
+%s
, seconds since 1970-01-01 00:00:00 UTC. (GNU Coreutils 8.24 Date manual)Example output now 1454000043.