Time is stored internally as the number of seconds with fraction since the epoch january 1 1970 00 00 utc also see the library module date.
Ruby time now without milliseconds.
You can use a method to get almost any format you need.
0900 z time zone name literal character.
Ruby formats time objects in a specific way by default.
X preferred representation for the date alone no time x preferred representation for the time alone no date y year without a century 00 99 y year with century z time zone as hour offset from utc e g.
This site provides the current time in milliseconds elapsed since the unix epoch jan 1 1970 as well as in other common formats including local utc time comparisons.
But that gets you this.
Something that adapts to your use case.
So you want to generate iso8601 formatted timestamps in ruby but need resolution finer than a second.
It is a thin layer over the system date and time functionality provided by the operating system.
This class may be unable on your system to represent dates before 1970 or after 2038.
T time now t zone cet t utc offset 3600 1 you can also get the current time in utc.
First make sure to require time in order to get iso8601 formatting.
But you may want something else.
The time class treats gmt greenwich mean time and utc coordinated universal time as equivalent gmt is the older way of referring to these baseline times but persists in the names of calls on posix systems.
Time now utc ruby time formatting.
2 1 0 001 require time true 2 1 0 002 time now utc iso8601 2015 11 12t04 46 43z the round method will get you finer resolution.