Is there an easy way to determine if a year is a leap year?
Date#leap?
now = DateTime.now flag = Date.leap?( now.year )
e.g.
Date.leap?( 2018 ) # => false Date.leap?( 2016 ) # => true
How do you convert a Unix timestamp (seconds since epoch) to Ruby DateTime?
How do you convert between a DateTime and a Time object in Ruby?
I have used a ruby script to convert iso time stamp to epoch, the files that I am parsing has following time stamp structure: 2009-03-08T00:27:31.807 Since I want to keep milliseconds I used following ruby code to convert …