[R] Converting time zones in R using metadata file information of video files, help needed.
Ronny Steen
kestrel1978 at gmail.com
Sun Nov 22 11:52:21 CET 2015
Hi,
I have video files (FAT) that are taken in a different timezone than my
current location. The modification date/time in the metafila data of the
video file shows the time video was taken, although in the current timezone
of my computer, if I understand right.
I wish to convert the date/time to the origin. The video was taken in
London, Ontario Canada at 2015-06-21 07:53:28, when looking at the metadata
of the file on my computer (timezone "Europe/Berlin") it says modification
date "2015-06-22 01:53:28". Hence, there is a 6 hour difference between the
two time-zones
I use the script provided here:
http://blog.revolutionanalytics.com/2009/06/converting-time-zones.html
pb.txt <- "2015-06-22 01:53:28" #modification date as shown on my
computer (timezone
"Europe/Berlin")
pb.date <- as.POSIXct(pb.txt, tz="Europe/London")
pb.date <- as.POSIXct(pb.txt, tz="America/Toronto")#timezone of origin
video camera location
format(pb.date, tz=local.time,usetz=TRUE) #formats the mtime to data and
time when the video was taken
[1] "2015-06-22 07:53:28 CEST" # the time is correct but the date is wrong
as it has added 6 hours rather than subtracting.
I find working with different time-zones to be difficult, I hope I managed
to formulate an understandable question.
Regards,
Kes
[[alternative HTML version deleted]]
More information about the R-help
mailing list