If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Help on date and time formats

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-20-04, 04:04
dbforums_ajayp dbforums_ajayp is offline
Registered User
 
Join Date: Feb 2004
Posts: 11
Question 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
Reply With Quote
  #2 (permalink)  
Old 02-20-04, 04:34
aigles aigles is offline
Registered User
 
Join Date: Jan 2004
Location: Bordeaux, France
Posts: 319
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On