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