RahulM
RahulM

Reputation: 29

How to convert Unix Timestamp to readable timestamp in AIX 5.3

I have a file with the below contents.

   MAX_FRAG_SIZE 1
   ACTIVE 3
   EFFECTIVE_TIME 1279057213
   COLLECT_TIR_INFO 1
   EXTENDED_SECURITY_INFO 3
   EFFECTIVE_TIME 1279057324
   ENABLE_PFI 0
   OFFHOST_BACKUP 0

The second field of EFFECTIVE_TIME is the timestamp. How can we convert the second field of EFFECTIVE_TIME into human readable format and replace it in the file itself. Also the strftime() function doesn't works in AIX 5.3.

Thanks Rahul

Upvotes: 0

Views: 222

Answers (1)

Lorinczy Zsigmond
Lorinczy Zsigmond

Reputation: 1910

Most certainly, 'strftime' works in AIX5.3. So does strtol, localtime_r, sprintf and other useful functions.

Also, you can install GNU!date, it can convert from timestamp to human readable form:

$ gdate --date='@1279057324'
Tue Jul 13 23:42:04 CEST 2010

Upvotes: 1

Related Questions