Sha256: c93401266b0cab7493d2c2e81ee21479391af4a05ea05df567a7a833cb24a8c7
Contents?: true
Size: 430 Bytes
Versions: 15
Compression:
Stored size: 430 Bytes
Contents
class DateTime def to_gm_time to_time(new_offset, :gm) end def to_local_time to_time(new_offset(DateTime.now.offset-offset), :local) end private def to_time(dest, method) #Convert a fraction of a day to a number of microseconds usec = (dest.sec_fraction * 60 * 60 * 24 * (10**6)).to_i Time.send(method, dest.year, dest.month, dest.day, dest.hour, dest.min, dest.sec, usec) end end
Version data entries
15 entries across 15 versions & 1 rubygems