Denis Vlasenko | 4d89a8b | 2008-04-25 02:14:07 +0000 | [diff] [blame] | 1 | dt=`busybox date` |
| 2 | # Expected format: Fri Apr 25 03:47:55 CEST 2008 |
| 3 | dt=`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/'` |
| 4 | test x"$dt" = x"OK" |
| 5 | |
| 6 | dt=`busybox date -d 1:2` |
Denis Vlasenko | 4809a9f | 2008-04-27 20:58:43 +0000 | [diff] [blame] | 7 | dt=`echo "$dt" | cut -b12-19` |
| 8 | test x"$dt" = x"01:02:00" |
Denis Vlasenko | 4d89a8b | 2008-04-25 02:14:07 +0000 | [diff] [blame] | 9 | |
| 10 | dt=`busybox date -d 1:2:3` |
Denis Vlasenko | 4809a9f | 2008-04-27 20:58:43 +0000 | [diff] [blame] | 11 | dt=`echo "$dt" | cut -b12-19` |
| 12 | test x"$dt" = x"01:02:03" |
Denis Vlasenko | 4d89a8b | 2008-04-25 02:14:07 +0000 | [diff] [blame] | 13 | |
| 14 | dt=`busybox date -d 1.2-3:4` |
Denis Vlasenko | 4809a9f | 2008-04-27 20:58:43 +0000 | [diff] [blame] | 15 | dt=`echo "$dt" | cut -b5-19` |
| 16 | test x"$dt" = x"Jan 2 03:04:00" |
Denis Vlasenko | 4d89a8b | 2008-04-25 02:14:07 +0000 | [diff] [blame] | 17 | |
| 18 | dt=`busybox date -d 1.2-3:4:5` |
Denis Vlasenko | 4809a9f | 2008-04-27 20:58:43 +0000 | [diff] [blame] | 19 | dt=`echo "$dt" | cut -b5-19` |
| 20 | test x"$dt" = x"Jan 2 03:04:05" |
Denis Vlasenko | 4d89a8b | 2008-04-25 02:14:07 +0000 | [diff] [blame] | 21 | |
| 22 | dt=`busybox date -d 1999.1.2-3:4` |
| 23 | dt=`echo "$dt" | cut -b1-19` |
| 24 | test x"$dt" = x"Sat Jan 2 03:04:00" |
| 25 | |
| 26 | dt=`busybox date -d 1999.1.2-3:4:5` |
| 27 | dt=`echo "$dt" | cut -b1-19` |
| 28 | test x"$dt" = x"Sat Jan 2 03:04:05" |
| 29 | |
| 30 | dt=`busybox date -d '1999-1-2 3:4:5'` |
| 31 | dt=`echo "$dt" | cut -b1-19` |
| 32 | test x"$dt" = x"Sat Jan 2 03:04:05" |
| 33 | |
| 34 | dt=`busybox date -d 01231133` |
Denis Vlasenko | 4809a9f | 2008-04-27 20:58:43 +0000 | [diff] [blame] | 35 | dt=`echo "$dt" | cut -b5-19` |
| 36 | test x"$dt" = x"Jan 23 11:33:00" |
Denis Vlasenko | 4d89a8b | 2008-04-25 02:14:07 +0000 | [diff] [blame] | 37 | |
| 38 | dt=`busybox date -d 012311332000` |
| 39 | dt=`echo "$dt" | cut -b1-19` |
| 40 | test x"$dt" = x"Sun Jan 23 11:33:00" |
| 41 | |
| 42 | dt=`busybox date -d 012311332000.30` |
| 43 | dt=`echo "$dt" | cut -b1-19` |
| 44 | test x"$dt" = x"Sun Jan 23 11:33:30" |