Camera timestamps

565pages on
this wiki

...some notes on how the cameras handles dates/times - by reyalP, taken from this forum post.

  • The following applies to both vxworks (a540) and dryos R31 (d10), except that a540 doesn't have DST or alternate timezone functions. Would be interesting to know if GPS enabled cams behave differently, since they do have an absolute time reference.

The timestamp returned by camera os.time is like a Unix timestamp, except it always treats the current camera time as UTC:

1:return:'Thu Jan  1 00:00:00 1970'

Switching to the alternate timezone on the camera UI changes the underlying timestamp (also timestamps recorded on the file, seen by stat):

Home timezone (PST):

con 4> =return,os.time()
5:return:'Sat Jan 28 16:01:58 2012'

Alternate timezone (IST, yes, it really is :30 off):

con 5> =return,os.time()
6:return:'Sun Jan 29 05:32:49 2012'
  • Exif values appear to be a straight strftime on the camera.

Assuming your camera and PC are set to the same local time, you just need the offset of PC local time from UTC in seconds to add or subtract. In PC side lua this can be obtained with

   local tslocal=os.time()
   local ttmp ='!*t',tslocal)
   ttmp.isdst  ='*t',tslocal).isdst
   return tslocal - os.time(ttmp)
  • If your camera time changes (due to using travel time zone, DST option, or setting the clock) there's really no way to recover the absolute time unless you kept track externally.

You can display a camera time in local PC time by pretending PC current timezone is UTC:

camera time:

1:return:'Sat Jan 28 16:01:34 2012'

PC, wrong:

="01/28/12 08:01:34"


="01/28/12 16:01:34"

(! in lua means display UTC... this doesn't work on the camera, of course)

Advertisement | Your ad here

Around Wikia's network

Random Wiki