![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
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. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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
|
|
#3
|
||||
|
||||
|
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. |
|
#4
|
|||
|
|||
|
Use the %s format suggested by Era.
Code:
$ date --utc --date "May 20 06:00" +%s 1211263200 |
|
#5
|
||||
|
||||
|
date --utc --date "May 20 06:00" +%s
its showing the following error date: illegal option -- - Usage: date [-u] [+Field Descriptors] |
|
#6
|
|||
|
|||
|
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.
|
|
#7
|
||||
|
||||
|
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 |
||||
| Google The UNIX and Linux Forums |