LTPDA Toolbox | contents | ![]() ![]() |
The following example creates an empty time object
t = time() ---------- time 01 ---------- name : None utc_epoch_milli: 1206904199919 timezone : UTC timeformat : yyyy-mm-dd HH:MM:SS.FFF time_str : 2008-03-30 19:09:59.919 created : 2008-03-30 19:09:59.919 version : $Id: time.m,v 1.33 2008/03/27 13:59:06 mauro Exp plist : -----------------------------
The following example creates a new time object by loading the time object from disk.
t = time('time.mat') t = time('time.xml')
Create a time object with different string formats.
t1 = time('14:00:00') % HH:MM:SS t1 = time('14:00:00.123') % HH:MM:SS.FFF t2 = time('2008.04.01 17:00:00') % yyyy.mm.dd. HH:MM:SS t3 = time('17:00:00 2008.04.01') % HH:MM:SS yyyy.mm.dd t4 = time('17:00:00 2008-04-01') % HH:MM:SS yyyy-mm-dd
You can combine the following string formats:
Create a time object with different string formats and a time format. The time format is either a MATLAB format string or a MATLAB format number.
t1 = time('14:00:00', 'HH:MM:SS') t2 = time('14:00:00', 'yyyy.mm.dd HH:MM:SS') t3 = time('14:00:00', 31) t4 = time('14:00:00', 17)
Create a time objrct from the unix epoch time. The epoch time starts from '1970-01-01 00:00:00.000'
Remark: the epoch time must be in milliseconds
t1 = time(0)
t2 = time(1206900000000) % 2008-03-30 18:00:00
Construct a TIME by its properties definition
'utc_epoch_milli' |
The time in milliseconds [default: 0] |
Additional parameters:
'timezone' |
Timezone (string or java object) [default: 'UTC'] |
'timeformat' |
Time format (string) |
pl1 = plist('utc_epoch_milli', 1206900000000); pl2 = plist('utc_epoch_milli', 1206900000000, ... 'timeformat', 'HH:MM:SS', ... 'timezone', 'CET'); t1 = time(pl1) t2 = time(pl2)
Construct a TIME by its properties definition
'time_str' |
the time string [default: '1970-01-01 00:00:00.000'] |
Additional parameters:
'timezone' |
Timezone (string or java object) [default: 'UTC'] |
'timeformat' |
Time format (string) |
pl1 = plist('time_str', '14:00:00 15.01.2008'); pl2 = plist('time_str', '14:00:00 15.01.2008', ... 'timeformat', 'HH:MM:SS', ... 'timezone', 'CET'); t1 = time(pl1) t2 = time(pl2)
![]() |
Constructor examples of the SPECWIN class | Constructor examples of the TIMESPAN class | ![]() |
©LTP Team