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