comparison m-toolbox/classes/@time/matfrmt2javafrmt.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 function frmt = matfrmt2javafrmt(frmt)
2 % convert MATLAB time formatting specification string into a Java one
3
4 % translate numeric MATLAB time formats into string ones
5 if isnumeric(frmt)
6 frmt = time.getdateform(frmt);
7 end
8
9 for kk = 1:length(frmt)
10 switch frmt(kk)
11 case 'm'
12 frmt(kk) = 'M';
13 case 'M'
14 frmt(kk) = 'm';
15 case 'S'
16 frmt(kk) = 's';
17 case 'F'
18 frmt(kk) = 'S';
19 case 'P'
20 if frmt(kk+1) == 'M'
21 frmt(kk) = 'a';
22 frmt(kk+1) = 'a';
23 end
24 end
25 end
26
27 % properly quote the T into ISO8896 date formats
28 frmt = strrep(frmt, 'T', '''T''');
29 end