The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
converting unix timestamp into readable format using c++ uselessprog High Level Programming 3 04-07-2008 12:07 PM
override the system date-timestamp on the Unix servers DavidH UNIX for Dummies Questions & Answers 5 09-27-2007 07:05 AM
get unix timestamp psimoes79 AIX 6 07-17-2007 06:23 AM
FTP from windows to Unix maintaining timestamp gauravgoel UNIX for Advanced & Expert Users 1 10-19-2006 12:04 PM
display the timestamp of a server UNIX nicolas UNIX for Dummies Questions & Answers 3 08-09-2001 06:26 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-20-2008
ali560045's Avatar
Registered User
 

Join Date: Oct 2007
Posts: 263
unix timestamp

hi,

i have heard that date and time stamp are stored somewhere in unix as an interger.

suppose May 20 07:05:59 is stored as 12342234

can anyone tell me where to find this integer.
Reply With Quote
Forum Sponsor
  #2  
Old 05-20-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
The integer is the number of seconds since January 1st, 1970. It's also called the Unix epoch. You can print it e.g. with the command date +%s
Reply With Quote
  #3  
Old 05-20-2008
ali560045's Avatar
Registered User
 

Join Date: Oct 2007
Posts: 263
thanks i got that.
Actuall my requirement is i have say file1 whose time is May 20 06:20.

How to covert this time into seconds.and after that converting the current time into seconds and subtracting both to get the delay time of file 1.

just consider this scenario:

file 1 -----May 20 06:20-------234567sec
current system time-May 21 01:49:35------------3455666sec

and then subtracting this two values,to get delay time of file 1.
Reply With Quote
  #4  
Old 05-21-2008
Registered User
 

Join Date: Oct 2006
Location: Belgium
Posts: 171
Use the %s format suggested by Era.

Code:
$ date --utc --date "May 20 06:00" +%s
1211263200
Reply With Quote
  #5  
Old 05-21-2008
ali560045's Avatar
Registered User
 

Join Date: Oct 2007
Posts: 263
date --utc --date "May 20 06:00" +%s

its showing the following error

date: illegal option -- -
Usage: date [-u] [+Field Descriptors]
Reply With Quote
  #6  
Old 05-21-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
There are different versions of the date command. If you are on Sun or HP-UX, see if you can find an XPG4 version. Or you could see if you have the stat command available.
Reply With Quote
  #7  
Old 05-21-2008
ali560045's Avatar
Registered User
 

Join Date: Oct 2007
Posts: 263
i have found the command and its working fine in linux, but not in IBM AIX 5.3

date '+%s' -r filename.

this command gives time in seconds of given filename.

i want to know the command in IBM AIX
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:07 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0