Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    11

    Question Unanswered: Help on date and time formats

    I want to do the following in UNIX shell script (written in csh):

    1) Get the time in seconds since 01.01.1970 (i.e. current datetime - 01.01.1970 = n seconds)

    2) Get the current datetime in 06.02.2004 01:58:06 (GMT+1) format.

    How can I do the above?
    Regards,

    Ajay Patel

  2. #2
    Join Date
    Jan 2004
    Location
    Bordeaux, France
    Posts
    320
    1) With GNU date command :
    Code:
    date +%s
    Without ... you must compute it
    see The armory.com Anonymous FTP Archives

    2)
    Code:
    TZ=GMT+1 date+'%d.%m.%Y  %H:%M:%S'
    Jean-Pierre.

Posting Permissions

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