LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices


Reply
  Search this Thread
Old 02-26-2009, 07:14 PM   #1
avklinux
Member
 
Registered: Nov 2008
Posts: 32

Rep: Reputation: 15
How to : Convert the epoch time to standard time with bash


Thanks
Avklinux
 
Old 02-26-2009, 07:21 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I don't know about AIX but on GNU/Linux in Bash you could
Code:
epoch2date() { EPOCH="$1"; date --date "$[$(date '+%s')-${EPOCH}] seconds ago" '+%Y-%m-%d %H:%M:%S'; }
or
date --date "$[$(date +%s)-${1}] seconds ago"

Last edited by unSpawn; 02-26-2009 at 07:23 PM.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Epoch time to Human Readable (using Date) true_atlantis Programming 1 05-09-2008 05:13 PM
PHP Time before Unix Epoch? wh33t Programming 2 08-29-2006 01:32 PM
Standard time to military time newuser455 General 6 12-07-2005 08:28 PM
Epoch time the other way! michedlp Programming 0 04-25-2004 03:51 AM

LinuxQuestions.org > Forums > Other *NIX Forums > AIX

All times are GMT -5. The time now is 01:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration