1dt=`busybox date`
2# Expected format: Fri Apr 25 03:47:55 CEST 2008
3dt=`echo "$dt" | sed 's/^[^ ][^ ][^ ] [^ ][^ ][^ ] [ 0123][0-9] [012][0-9]:[0-5][0-9]:[0-6][0-9] [A-Z][A-Z]* [012][0-9][0-9][0-9]$/OK/'`
4test x"$dt" = x"OK"
5
6dt=`busybox date -d 1:2`
7dt=`echo "$dt" | cut -b12-19`
8test x"$dt" = x"01:02:00"
9
10dt=`busybox date -d 1:2:3`
11dt=`echo "$dt" | cut -b12-19`
12test x"$dt" = x"01:02:03"
13
14dt=`busybox date -d 1.2-3:4`
15dt=`echo "$dt" | cut -b5-19`
16test x"$dt" = x"Jan  2 03:04:00"
17
18dt=`busybox date -d 1.2-3:4:5`
19dt=`echo "$dt" | cut -b5-19`
20test x"$dt" = x"Jan  2 03:04:05"
21
22dt=`busybox date -d 1999.1.2-3:4`
23dt=`echo "$dt" | cut -b1-19`
24test x"$dt" = x"Sat Jan  2 03:04:00"
25
26dt=`busybox date -d 1999.1.2-3:4:5`
27dt=`echo "$dt" | cut -b1-19`
28test x"$dt" = x"Sat Jan  2 03:04:05"
29
30dt=`busybox date -d '1999-1-2 3:4:5'`
31dt=`echo "$dt" | cut -b1-19`
32test x"$dt" = x"Sat Jan  2 03:04:05"
33
34# date (GNU coreutils) 8.17 doesn't accept 01231133 either:
35# date: invalid date '01231133'
36#dt=`busybox date -d 01231133`
37#dt=`echo "$dt" | cut -b5-19`
38#test x"$dt" = x"Jan 23 11:33:00"
39
40dt=`busybox date -d 200001231133`
41dt=`echo "$dt" | cut -b1-19`
42test x"$dt" = x"Sun Jan 23 11:33:00"
43
44dt=`busybox date -d 200001231133.30`
45dt=`echo "$dt" | cut -b1-19`
46test x"$dt" = x"Sun Jan 23 11:33:30"
47