Bug 365 - [busybox] date command does not accept linux time setting format
Summary: [busybox] date command does not accept linux time setting format
Status: VERIFIED NOTABUG
Alias: None
Product: Meta-yocto
Classification: Build System, Metadata & Runtime
Component: meta-yocto (show other bugs)
Version: 0.9
Hardware: x86 Multiple
: Medium normal
Target Milestone: 0.9 M4
Assignee: Saul Wold
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2010-09-29 20:29 UTC by Jiajun Xu
Modified: 2010-12-21 06:07 UTC (History)
8 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified: Program Management
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiajun Xu 2010-09-29 20:29:13 UTC
Testing Env:    
Host: Ubuntu 10.04.1 LTS
Poky gitinfo: cf09c7a1e35a0dc3219fa196e8811c50957be4a2
All images from autobuilder: http://autobuilder.pokylinux.org/nightly/20100928-1/

The date command seems change in latest build. It's from busybox now. And date command currently does not accept linux time setting format, which cause I not able to change time correctly.

In previous testing, such format used to work. So I think the date command changes in latest build.

#######
root@netbook:~# date -R
Sun, 08 Aug 2010 08:08:05 +0000

root@netbook:~# date -s 20080908
Mon Aug  8 09:08:00 UTC 2011
#######

#######
root@netbook:~# date -h
date: invalid option -- 'h'
BusyBox v1.16.2 (2010-09-28 00:50:39 PDT) multi-call binary.

Usage: date [OPTIONS] [+FMT] [TIME]
#######


Reproduce Steps:
1. Download latest build from autobuilder
2. Boot up the images
3. Launch terminal
4. Run "date -R" and check the output
5. Run "date -s "20080908"" and check the output
Comment 1 Saul Wold 2010-09-30 15:05:19 UTC
There are 2 different date commands as you noticed, depending on which image you are looking at it will either be from busybox as you noted or from coreutils. Yes the behaviour of the 2 is subtly different.

You will find busybox version in minimal and sato, while the coreutils version will be in sdk, basic and lsb.

The busybox version uses the following options:
    date [OPTIONS] [+FMT] [TIME]

    Display time (using +FMT), or set time

    Options:

            [-s] TIME       Set time to TIME
            -u              Work in UTC (don't convert to local time)
            -R              Output RFC-822 compliant date string
            -I[SPEC]        Output ISO-8601 compliant date string
                            SPEC='date' (default) for date only,
                            'hours', 'minutes', or 'seconds' for date and
                            time to the indicated precision
            -r FILE         Display last modification time of FILE
            -d TIME         Display TIME, not 'now'
            -D FMT          Use FMT for -d TIME conversion

    Recognized TIME formats:

            hh:mm[:ss]
            [YYYY.]MM.DD-hh:mm[:ss]
            YYYY-MM-DD hh:mm[:ss]
            [[[[[YY]YY]MM]DD]hh]mm[.ss]

While the coreutils version of date has the following expanded options:

     date [option]... [+format]
     date [-u|--utc|--universal] 
     [ MMDDhhmm[[CC]YY][.ss] ]

Notice the difference in the nesting of optional date with the [] between the 2 versions.

See: http://www.gnu.org/software/coreutils/manual/coreutils.html#date-invocation
for more details
Comment 2 Jiajun Xu 2010-10-03 08:01:52 UTC
Thanks for your explanation, it's clear for me now. Verify the bug.