Home > m > timetools > ltpda_reformat_date.m

ltpda_reformat_date

PURPOSE ^

LTPDA_REFORMAT_DATE reformats the input date

SYNOPSIS ^

function s = ltpda_reformat_date (s)

DESCRIPTION ^

 LTPDA_REFORMAT_DATE reformats the input date

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: LTPDA_REFORMAT_DATE reformats the input date of the (preferred)
              form 'yyyy-mm-dd HH:MM:SS' to the format 'mm-dd-yyyy HH:MM:SS'
              which works with datenum.

 CALL:       s  = ltpda_reformat_date(si)

 INPUTS:     si - date string in the format 'yyyy-mm-dd HH:MM:SS'

 OUTPUTS:    s  - date string in the format 'mm-dd-yyyy HH:MM:SS'

 EXAMPLE:    dnum = datenum(ltpda_reformat_date('2007-05-04 22:34:22'));

 VERSION: $Id: ltpda_reformat_date.html,v 1.12 2008/03/31 10:27:44 hewitson Exp $

 HISTORY: 03-06-2007 M Hewitson
             Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function s = ltpda_reformat_date (s)
0002 % LTPDA_REFORMAT_DATE reformats the input date
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: LTPDA_REFORMAT_DATE reformats the input date of the (preferred)
0007 %              form 'yyyy-mm-dd HH:MM:SS' to the format 'mm-dd-yyyy HH:MM:SS'
0008 %              which works with datenum.
0009 %
0010 % CALL:       s  = ltpda_reformat_date(si)
0011 %
0012 % INPUTS:     si - date string in the format 'yyyy-mm-dd HH:MM:SS'
0013 %
0014 % OUTPUTS:    s  - date string in the format 'mm-dd-yyyy HH:MM:SS'
0015 %
0016 % EXAMPLE:    dnum = datenum(ltpda_reformat_date('2007-05-04 22:34:22'));
0017 %
0018 % VERSION: $Id: ltpda_reformat_date.html,v 1.12 2008/03/31 10:27:44 hewitson Exp $
0019 %
0020 % HISTORY: 03-06-2007 M Hewitson
0021 %             Creation
0022 %
0023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0024 
0025 % reformt string to stupid matlab format MM-DD-YYY
0026 s=strcat(s(6:10),'-',s(1:4),s(11:length(s)));
0027 
0028

Generated on Mon 31-Mar-2008 12:20:24 by m2html © 2003