3 dt=`busybox date -d 1:2 +%T`
4 test x"$dt" = x"01:02:00"
6 dt=`busybox date -d 1:2:3 +%T`
7 test x"$dt" = x"01:02:03"
11 # date (GNU coreutils) 6.10 reports:
12 # date: invalid date '1.2-3:4'
13 # busybox 1.11.0.svn date reports:
14 # date: invalid date '1/2 3:4'
16 # TODO: (1) compare with strings, not "host date"
17 # (2) implement d/m[/y] hh:mm[:ss] fmt in date applet
18 #hdt=`$host_date -d '1/2 3:4'`
19 #dt=`busybox date -d 1.2-3:4`
20 #test x"$hdt" = x"$dt"
22 #hdt=`$host_date -d '1/2 3:4:5'`
23 #dt=`busybox date -d 1.2-3:4:5`
24 #test x"$hdt" = x"$dt"
26 #hdt=`$host_date -d '1/2/1999 3:4'`
27 #dt=`busybox date -d 1999.1.2-3:4`
28 #test x"$hdt" = x"$dt"
30 #hdt=`$host_date -d '1/2/1999 3:4:5'`
31 #dt=`busybox date -d 1999.1.2-3:4:5`
32 #test x"$hdt" = x"$dt"
34 hdt=`$host_date -d '1999-1-2 3:4:5'`
35 dt=`busybox date -d '1999-1-2 3:4:5'`
38 # Avoiding using week day in this evaluation, as it's mostly different every year
39 # date (GNU coreutils) 6.10 reports:
40 # date: invalid date '01231133'
41 dt=`busybox date -d 01231133 +%c`
42 dt=`echo "$dt" | cut -b5-19`
43 test x"$dt" = x"Jan 23 11:33:00"
45 # date (GNU coreutils) 6.10 reports:
46 # date: invalid date '012311332000'
47 dt=`busybox date -d 200001231133 +%c`
48 test x"$dt" = x"Sun Jan 23 11:33:00 2000"
50 # date (GNU coreutils) 6.10 reports:
51 # date: invalid date '012311332000'
52 dt=`busybox date -d 200001231133.30 +%c`
53 test x"$dt" = x"Sun Jan 23 11:33:30 2000"
55 lcbbd="LC_ALL=C busybox date"
56 wd=$(eval $lcbbd +%a) # weekday name
57 mn=$(eval $lcbbd +%b) # month name
58 dm=$(eval $lcbbd +%e) # day of month, space padded
59 h=$(eval $lcbbd +%H) # hour, zero padded
60 m=$(eval $lcbbd +%M) # minute, zero padded
61 s=$(eval $lcbbd +%S) # second, zero padded
62 z=$(eval $lcbbd -u +%Z) # time zone abbreviation
63 y=$(eval $lcbbd +%Y) # year
117 [ $dm -ge 1 ] && [ $dm -le 31 ] || res=BAD
119 [ $h -ge 0 ] && [ $h -le 23 ] || res=BAD
121 [ $m -ge 0 ] && [ $m -le 59 ] || res=BAD
123 [ $s -ge 0 ] && [ $s -le 59 ] || res=BAD
124 [ $z = UTC ] || res=BAD
125 [ $y -ge 1970 ] || res=BAD
129 # This should error out (by showing usage text). Testing for that
130 dt=`busybox date -d 012311332000.30 %+c 2>&1 | head -n 1`
131 test x"${dt##BusyBox * multi-call binary*}" = x""