bb date

walter harms wharms at bfs.de
Fri Sep 8 09:44:48 UTC 2006


Hi chey,
i had the same problem some time ago (with -d <datum> and format was not
supported with bb). Since the gnu-date parser is rather large, i added the
-D switch as hint.

perhaps you can change the code to use the -D switch for interpreting the
-s String. that would be a BB extension but i see that it would be helpful.

re,
 wh


Chey wrote:
> By "portability" setting the date I mean using the same command and
> date format to set the date wether it be using BB's date command or
> the using the date command packaged with coreutils. For example, the
> following two commands work with busybox's date command but do not
> work on my Debian system which has a default coreutils package
> installed.
> 
> devbox:/# date -s `date +%m%d%H%M%Y.%S`
> date: invalid date `090719502006.56'
> devbox:/# date -s `date +%Y.%m.%d-%H:%M:%S`
> date: invalid date `2006.09.07-19:51:14'
> 
> It seems that the only two formats that the BB date command supports
> are the two formats above which do not work with Debian and probably
> don't work with other systems. The second format above seems to be
> custom to BB.
> 
> To sum things up, I'm looking for the BB date command to accept more
> (at least one) standard date format when setting the date.
> 
> If BB supports another format and I missed this in the code please let me know.
> 
> Thanks,
> Chey
> 
> 
> On 9/7/06, Rich Felker <dalias at aerifal.cx> wrote:
>> On Thu, Sep 07, 2006 at 02:50:10PM -0400, Chey wrote:
>>> BB's date command seems to only accept two formats for setting the
>>> date. Are these to formats subject to bb's date command only or should
>>> those two formats work on other distros as well?
>>>
>>> I'm asking because I cannot set the date with bb's date command and
>>> use that same command to set the date on my Debian box.
>>>
>>> I'm having trouble creating a portable script to set the date because of this.
>> There's no such thing as "portably setting the date" since POSIX does
>> not specify that the date can be changed at all. :) However in terms
>> of working on most/all legacy implementations and BB, I believe one of
>> the formats works well. Look at the comments in the source; I seem to
>> remember them being helpful.
>>
>> Rich
>>
>> _______________________________________________
>> busybox mailing list
>> busybox at busybox.net
>> http://busybox.net/cgi-bin/mailman/listinfo/busybox
>>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/cgi-bin/mailman/listinfo/busybox
> 
> 
> 



More information about the busybox mailing list