Home > atmlab > time > iso_timestamp.m

iso_timestamp

PURPOSE ^

iso_timestamp Return string with current ISO date-time.

SYNOPSIS ^

function utc_datestr = iso_timestamp()

DESCRIPTION ^

 iso_timestamp Return string with current ISO date-time.

 Returns a string representing the full current date/time in UTC
 according to ISO 8601, in connected format. E.g.
 
 iso_timestamp() = '2012-01-31T10:49:32Z'

 FORMAT

    s = iso_timestamp()

 IN (none)

 OUT s     string (character-array) with ISO time

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

iso_timestamp.m

SOURCE CODE ^

0001 function utc_datestr = iso_timestamp()
0002 
0003 % iso_timestamp Return string with current ISO date-time.
0004 %
0005 % Returns a string representing the full current date/time in UTC
0006 % according to ISO 8601, in connected format. E.g.
0007 %
0008 % iso_timestamp() = '2012-01-31T10:49:32Z'
0009 %
0010 % FORMAT
0011 %
0012 %    s = iso_timestamp()
0013 %
0014 % IN (none)
0015 %
0016 % OUT s     string (character-array) with ISO time
0017 
0018 % $Id: iso_timestamp.m 8141 2013-01-24 16:09:17Z gerrit $
0019 
0020 utc_time = java.lang.System.currentTimeMillis;
0021 [utc_date{1:6}] = unixsecs2date(uint32(floor(utc_time/1000)));
0022 utc_datestr = sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ', ...
0023     utc_date{1:6});
0024 
0025 end

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005