• Re: date for week

    From Jeff Peng@21:1/5 to All on Tue Jun 11 01:50:01 2024
    thanks roberto. that's exactly what i am looking for.


    $ date +%a

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeff Peng@21:1/5 to All on Tue Jun 11 01:30:01 2024
    Hello,

    I run the folllowing command,

    $ date +%w
    2


    While I expect the output should be:

    $ date +%such_a_option
    Tuesday

    or
    $ date +%such_a_option
    Tue

    does date command has this option?

    Thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roberto =?iso-8859-1?Q?C=2E_S=E1nch@21:1/5 to Jeff Peng on Tue Jun 11 01:30:01 2024
    On Tue, Jun 11, 2024 at 07:19:42AM +0800, Jeff Peng wrote:
    Hello,

    I run the folllowing command,

    $ date +%w
    2


    While I expect the output should be:

    $ date +%such_a_option
    Tuesday

    or
    $ date +%such_a_option
    Tue

    does date command has this option?

    Thanks.


    You probably want:

    $ date +%a
    Mon
    $ date +%A
    Monday

    --
    Roberto C. Sánchez

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Jeff Peng on Tue Jun 11 01:50:01 2024
    On Tue, Jun 11, 2024 at 07:19:42AM +0800, Jeff Peng wrote:
    While I expect the output should be:

    $ date +%such_a_option
    Tuesday

    or
    $ date +%such_a_option
    Tue

    does date command has this option?

    You can run the command "man date" to read the short version of the documentation. This will include the information you wanted. Search
    for "week" and it takes you right there:

    %a locale's abbreviated weekday name (e.g., Sun)

    %A locale's full weekday name (e.g., Sunday)

    %b locale's abbreviated month name (e.g., Jan)

    %B locale's full month name (e.g., January)

    %c locale's date and time (e.g., Thu Mar 3 23:05:25 2005)

    Should you ever feel a need to read the longer version of the
    documentation, it's in GNU info pages. So you would need to type
    the command "info coreutils date" to get to it. And then you'd need
    to figure out the user interface of the "info" program, which is not
    intuitive unless you happen to be an emacs power user already.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From rtnetzlof@windstream.net@21:1/5 to All on Tue Jun 11 01:50:01 2024
    All the format codes are documented in the man page for date.
    in particular:

    +%a gives a short form, such as Mon
    +%A gives full name, e.g. Monday
    +%^a and +%^A as above, but all capital letters.

    ----- Original Message -----
    From: "Jeff Peng" <jeff@tls-mail.com>
    To: "debian-user" <debian-user@lists.debian.org>


    While I expect the output should be:

    $ date +%such_a_option
    Tuesday

    or
    $ date +%such_a_option
    Tue

    does date command has this option?

    Yes, see above.

    --
    Bob Netzlof a/k/a Sweet Old Bob

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)