0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 % taken verbatim from 'datestr.m' in MATLAB R2008b
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 function formatstr = getdateform(dateform)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 % determine date format string from date format index.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 switch dateform
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 case -1, formatstr = 'dd-mmm-yyyy HH:MM:SS';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 case 0, formatstr = 'dd-mmm-yyyy HH:MM:SS';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 case 1, formatstr = 'dd-mmm-yyyy';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 case 2, formatstr = 'mm/dd/yy';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 case 3, formatstr = 'mmm';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 case 4, formatstr = 'm';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 case 5, formatstr = 'mm';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 case 6, formatstr = 'mm/dd';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 case 7, formatstr = 'dd';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 case 8, formatstr = 'ddd';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 case 9, formatstr = 'd';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 case 10, formatstr = 'yyyy';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 case 11, formatstr = 'yy';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 case 12, formatstr = 'mmmyy';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 case 13, formatstr = 'HH:MM:SS';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 case 14, formatstr = 'HH:MM:SS PM';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 case 15, formatstr = 'HH:MM';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23 case 16, formatstr = 'HH:MM PM';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 case 17, formatstr = 'QQ-YY';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 case 18, formatstr = 'QQ';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 case 19, formatstr = 'dd/mm';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 case 20, formatstr = 'dd/mm/yy';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 case 21, formatstr = 'mmm.dd,yyyy HH:MM:SS';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 case 22, formatstr = 'mmm.dd,yyyy';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 case 23, formatstr = 'mm/dd/yyyy';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 case 24, formatstr = 'dd/mm/yyyy';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 case 25, formatstr = 'yy/mm/dd';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 case 26, formatstr = 'yyyy/mm/dd';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 case 27, formatstr = 'QQ-YYYY';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 case 28, formatstr = 'mmmyyyy';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 case 29, formatstr = 'yyyy-mm-dd';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37 case 30, formatstr = 'yyyymmddTHHMMSS';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 case 31, formatstr = 'yyyy-mm-dd HH:MM:SS';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39 otherwise
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 error('MATLAB:datestr:DateNumber',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41 'Unknown date format number: %s', dateform);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44
|