+ Reply to Thread
Results 1 to 3 of 3

Thread: Shell Script Date YYYYMMDD Format

  1. #1
    Tor
    Tor is offline Programming Expert
    Join Date
    Oct 2007
    Posts
    488
    Rep Power
    0

    Shell Script Date YYYYMMDD Format

    I just spent 30 minutes finding this information so I thought I would post it. If you need the date and time in a shell script with YYYYMMDD format and HHMM format here is the script commands:

    Code:
    TIME=$(date +%k%M)
    DAY=`/bin/date +%Y%m%d`
    Output:
    Code:
    1305
    20080818

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    v0id is offline Retired
    Join Date
    Apr 2007
    Posts
    2,937
    Blog Entries
    3
    Rep Power
    42
    The man-page of date has all the specifiers listed.

  4. #3
    Tor
    Tor is offline Programming Expert
    Join Date
    Oct 2007
    Posts
    488
    Rep Power
    0
    It does, so you can use the man page and change the above script as you need.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 5 users browsing this thread. (0 members and 5 guests)

Similar Threads

  1. How to format date in PHP?
    By newphpcoder in forum PHP Development
    Replies: 6
    Last Post: 10-25-2011, 05:24 PM
  2. Date Format Processing
    By sam_coder in forum Java Help
    Replies: 2
    Last Post: 06-13-2011, 01:39 PM
  3. Check date format
    By toto_7 in forum Java Help
    Replies: 9
    Last Post: 06-01-2011, 03:57 PM
  4. [HELP] convert Perl script to Bash shell script
    By Egypte in forum Linux Programming and Scripting
    Replies: 2
    Last Post: 04-24-2011, 05:37 PM
  5. Date Format In Basic C Language ?
    By SlimShady in forum C and C++
    Replies: 4
    Last Post: 10-06-2010, 07:23 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts