invalid options with date

ITwrx.org info at itwrx.org
Fri Sep 23 00:02:06 UTC 2016


On 09/22/2016 06:14 PM, Jeremy Chadwick wrote:
> The reason date -h etc. doesn't work is because, as described, your
> Busybox was built with support for such disabled.  You will need to talk
> to whoever maintains your Busybox package/install, or if that's you,
> then you need to consider tweaking the config further for such.
>
> I have no problem with date on Busybox 1.25.0 with regards to most of
> your script's date syntaxes, as well as others shown in the syntax
> usage.
>
> First, your TODAY:
>
> root at gw:/tmp/home/root# date +"%Y-%m-%d"
> 2016-09-22
>
> Now your tmpDays, but I'll use a different date than the above, to show
> it's working:
>
> root at gw:/tmp/home/root# date --date="2002-12-20"
> Fri Dec 20 00:00:00 PST 2002
> root at gw:/tmp/home/root# date --date="2002-12-20" +%s
> 1040371200
>
> Verifying that UNIX timestamp correlates with the correct date:
>
> root at gw:/tmp/home/root# perl -e 'print scalar localtime(1040371200), "\n";'
> Fri Dec 20 00:00:00 2002
>
> In tmpDays, you use something called $birthdate, which uses variables
> that aren't defined (in the code you showed), so I can't tell if they're
> 2-digit years, 4-digit years, variable-width month values, or what, thus
> I cannot test that.
>
> The only two compile-time date tweaking options I see are
> CONFIG_FEATURE_DATE_ISOFMT and CONFIG_FEATURE_DATE_COMPAT, but I don't
> believe these are relevant:
>
>  33 //config:config FEATURE_DATE_ISOFMT
>  34 //config:   bool "Enable ISO date format output (-I)"
>  35 //config:   default y
>  36 //config:   depends on DATE
>  37 //config:   help
>  38 //config:     Enable option (-I) to output an ISO-8601 compliant
>  39 //config:     date/time string.
>  40 //config:
>
>  50 //config:config FEATURE_DATE_COMPAT
>  51 //config:   bool "Support weird 'date MMDDhhmm[[YY]YY][.ss]' format"
>  52 //config:   default y
>  53 //config:   depends on DATE
>  54 //config:   help
>  55 //config:     System time can be set by 'date -s DATE' and simply 'date DATE',
>  56 //config:     but formats of DATE string are different. 'date DATE' accepts
>  57 //config:     a rather weird MMDDhhmm[[YY]YY][.ss] format with completely
>  58 //config:     unnatural placement of year between minutes and seconds.
>  59 //config:     date -s (and other commands like touch -d) use more sensible
>  60 //config:     formats (for one, ISO format YYYY-MM-DD hh:mm:ss.ssssss).
>  61 //config:
>  62 //config:     With this option off, 'date DATE' is 'date -s DATE' support
>  63 //config:     the same format. With it on, 'date DATE' additionally supports
>  64 //config:     MMDDhhmm[[YY]YY][.ss] format.
>
> That leaves reviewing changes between Busybox 1.24.2 and 1.25.0, so
> let's look at that, specifically looking for tags of 1_24_2 and 1_25_0:
>
> 1_25_stable: https://git.busybox.net/busybox/log/?h=1_25_stable
> 1_24_stable: https://git.busybox.net/busybox/log/?h=1_24_stable
>
> I see nothing in the 1_24_stable commit history, after 1_24_2, that
> indicates fixes/tweaks for date, so I don't have an immediate
> explanation.
>
> That said: is there a reason you're omitting depiction of the actual
> problem?  You've given descriptions, but aren't pasting full terminal
> output.  It would help because then one could reverse-engineer some of
> the messages shown back to code and see if the cause could be
> determined.
>
i understand you to be saying that "-d" and "--date" are both supported
in the official busybox, so i'll either try a different busybox app or
contact the developer of this particular busybox android app. thanks for
all the info. above and beyond the call of duty.




More information about the busybox mailing list