I have a time that is read in to the Time class. The time is UTC but
Ruby doesn’t know that. I can’t figure out how to make it UTC.
Details
- The date is read from a photo file, e.g. a jpg, that has EXIF
information including the time that it was taken and my camera is always
on UTC. The gem mini_exiftool reads in the date that the photo was
captured. And the class is Time. That part of the script and the result
fileEXIF = MiniExiftool.new(fn)
fileDateUTC = fileEXIF.dateTimeOriginal
puts "fileDateUTC: #{fileDateUTC}. fileDateUTC.class:
#{fileDateUTC.class}. "
fileDateUTC: Thu Oct 14 09:46:22 -0700 2010. fileDateUTC.class: Time.
BTW, that time is really UTC even though it says GMT -7 (GMT -7 being
the time for the computer, not the photo). The photo was taken at
15:31:22 in Nepal which is GMT +5.75
How do I tell Ruby that the time is UTC? I could work with the time
coerced to DateTime, but can’t figure out how to do that.
Thanks for any advice.
PS I’m very much a newbie with very limited programming experience.