The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
epoch time in shell script robsonde SUN Solaris 14 05-12-2009 01:08 PM
epoch time ali560045 Shell Programming and Scripting 3 06-02-2008 05:41 AM
EPOCH to real time? TheEngineer UNIX for Advanced & Expert Users 5 07-18-2006 09:30 AM
Epoch time 12yearold UNIX for Advanced & Expert Users 2 07-14-2006 04:11 PM
how to convert epoch time to readible format? cin2000 Shell Programming and Scripting 11 12-19-2005 07:14 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-14-2006
12yearold 12yearold is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 22
Epoch time

Guys, i have a question...

I have 2 sets of data say "a" and "a+1" which has values in epoch time..

Question is... if i were to get the time difference where diff = "a+1" - "a"
can i convert it back to real time duration after the subtraction...
OR i need to convert em first before i do the subtraction to get the real time results in seconds and minutes...

Appreciate some light here...

thanks
  #2 (permalink)  
Old 07-14-2006
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,800
epoch time (for UNIX) is given as the number of seconds elapsed since 00:00:00 January 1, 1970. It can be converted to all kinds of formats.

Show us one of your data items.

To answer your question - if they are in a format that looks like this: 1152692657
then they are in the primary format. Subtract first, then convert. Otherwise, convert to seconds elapsed since Jan 1 1970, then subtract, then convert back to elapsed time.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0