1 dt=`busybox date -d 1:2 +%T`
2 test x"$dt" = x"01:02:00"
4 dt=`busybox date -d 1:2:3 +%T`
5 test x"$dt" = x"01:02:03"
9 # date (GNU coreutils) 6.10 reports:
10 # date: invalid date '1.2-3:4'
11 # busybox 1.11.0.svn date reports:
12 # date: invalid date '1/2 3:4'
14 hdt=`$host_date -d '1/2 3:4'`
15 dt=`busybox date -d 1.2-3:4`
18 hdt=`$host_date -d '1/2 3:4:5'`
19 dt=`busybox date -d 1.2-3:4:5`
22 hdt=`$host_date -d '1/2/1999 3:4'`
23 dt=`busybox date -d 1999.1.2-3:4`
26 hdt=`$host_date -d '1/2/1999 3:4:5'`
27 dt=`busybox date -d 1999.1.2-3:4:5`
30 hdt=`$host_date -d '1999-1-2 3:4:5'`
31 dt=`busybox date -d '1999-1-2 3:4:5'`
34 # Avoid using week day in this evaluation, as it's mostly different every year
35 # date (GNU coreutils) 6.10 reports:
36 # date: invalid date '01231133'
37 dt=`busybox date -d 01231133 +%c`
38 dt=`echo "$dt" | cut -b5-19`
39 test x"$dt" = x"Jan 23 11:33:00"
41 # date (GNU coreutils) 6.10 reports:
42 # date: invalid date '012311332000'
43 dt=`busybox date -d 012311332000 +%c`
44 test x"$dt" = x"Sun Jan 23 11:33:00 2000"
46 # date (GNU coreutils) 6.10 reports:
47 # date: invalid date '012311332000'
48 dt=`busybox date -d 012311332000.30 +%c`
49 test x"$dt" = x"Sun Jan 23 11:33:30 2000"
51 lcbbd="LC_ALL=C busybox date"
52 wd=$(eval $lcbbd +%a) # weekday name
53 mn=$(eval $lcbbd +%b) # month name
54 dm=$(eval $lcbbd +%e) # day of month, space padded
55 h=$(eval $lcbbd +%H) # hour, zero padded
56 m=$(eval $lcbbd +%M) # minute, zero padded
57 s=$(eval $lcbbd +%S) # second, zero padded
58 z=$(eval $lcbbd -u +%Z) # time zone abbreviation
59 y=$(eval $lcbbd +%Y) # year
113 [ $dm -ge 1 ] && [ $dm -le 31 ] || res=BAD
115 [ $h -ge 0 ] && [ $h -le 23 ] || res=BAD
117 [ $m -ge 0 ] && [ $m -le 59 ] || res=BAD
119 [ $s -ge 0 ] && [ $s -le 59 ] || res=BAD
120 [ $z = UTC ] || res=BAD
121 [ $y -ge 1970 ] || res=BAD
125 if dt=`busybox date -d 012311332000.30 %+c`; then
126 echo "Expected this to fail with: \"date: invalid date '%+c'\"" >&2