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.m,v 1.1 2007/07/25 09:21:35 ingo Exp $ HISTORY: 03-06-2007 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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.m,v 1.1 2007/07/25 09:21:35 ingo 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