comparison m-toolbox/classes/+utils/@timetools/reformat_date.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % REFORMAT_DATE reformats the input date
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: REFORMAT_DATE reformats the input date of the (preferred)
5 % form 'yyyy-mm-dd HH:MM:SS' to the format 'mm-dd-yyyy HH:MM:SS'
6 % which works with datenum.
7 %
8 % CALL: s = reformat_date(si)
9 %
10 % INPUTS: si - date string in the format 'yyyy-mm-dd HH:MM:SS'
11 %
12 % OUTPUTS: s - date string in the format 'mm-dd-yyyy HH:MM:SS'
13 %
14 % EXAMPLE: dnum = datenum(reformat_date('2007-05-04 22:34:22'));
15 %
16 % VERSION: $Id: reformat_date.m,v 1.1 2008/08/05 18:07:59 ingo Exp $
17 %
18 % HISTORY: 03-06-2007 M Hewitson
19 % Creation
20 %
21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22
23 function s = reformat_date (s)
24
25 % reformt string to stupid matlab format MM-DD-YYY
26 s=strcat(s(6:10),'-',s(1:4),s(11:length(s)));
27
28 end