Home > utility > getDateTime.m

getDateTime

PURPOSE ^

getDate: Get date in yyyymmdd format

SYNOPSIS ^

function [yyyymmdd, time] = getDateTime

DESCRIPTION ^

 getDate: Get date in yyyymmdd format
    Usage: [yyyymmdd, time] = getDateTime

    For example:
        [yyyymmdd, time]=getDateTime

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [yyyymmdd, time] = getDateTime
0002 % getDate: Get date in yyyymmdd format
0003 %    Usage: [yyyymmdd, time] = getDateTime
0004 %
0005 %    For example:
0006 %        [yyyymmdd, time]=getDateTime
0007 
0008 %    Roger Jang, 20050827
0009 
0010 vec=datevec(now);
0011 yyyymmdd=sprintf('%04d%02d%02d', vec(1), vec(2), vec(3));
0012 time=sprintf('%02d%02d%02d', vec(4), vec(5), round(vec(6)));

Generated on Tue 01-Jun-2010 09:50:34 by m2html © 2003