Matlab-Unix time conversion

Captured at: 2013-05-23 07:57:54 UTC

When I use Matlab to process data files I’ve stored on robots an important conversion step is to go from UTC to datenum. Realizing that these one-line conversions may be useful to others, I’m putting them up for download here as a toolbox called umtConv. Just download, unzip and add it to your path and start using it.

Example usage for unixTimeToDateNum:

Usage for unixTimeToDateNum

>> startTime = 1343453799.64108;
finTime = 1343535910.48285;
>> t=[startTime,finTime]
t =
          1343453799.64108          1343535910.48285
>> finTime=unixTimeToDateNum( t )
finTime =
          735078.233792142          735079.184149107

Example usage for dateNumToUnixTime:

Example usage for unixTimeToDateNum

>> dn = [datenum('2012-10-2 20:20:10.23456'),datenum(2012,10,2,23,59,59)]
dn =
          735144.847340678          735144.999988426
>> t = dateNumToUnixTime( dn )
t =
           1349209210.2346                1349222399