How to check that a particular value is epoch seconds?

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat How to check that a particular value is epoch seconds?
# 1  
Old 05-18-2013
How to check that a particular value is epoch seconds?

how to verify that the following is epoch time.
that is if i have given some random value like 34600 , how can i know it is
epoch seconds
# 2  
Old 05-18-2013
I could be epoch seconds or not, you cannot tell by simply looking at a number.
# 3  
Old 05-18-2013
i didn't get you , actually i am asking that if certain epoch value is given then how can i verify it that it is epoch time
# 4  
Old 05-18-2013
Any value between 0 and $(date +%s) can be an epoch value
# 5  
Old 05-19-2013
And numbers larger than that if the epoch value refers to some point-in-time in the future..
# 6  
Old 05-19-2013
The standards say that the type time_t is an integral type. They don't specify whether the type is signed or unsigned. On systems with a signed 64-bit time_t, any time from the big bang to the expected collapse of the universe, could be represented as a value specifying seconds before or after the epoch.
These 3 Users Gave Thanks to Don Cragun For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert a future date into epoch seconds on HPUX system

Hi All, I have scenario where i have to compare two dates. I thought of converting them to epoch seconds and do a numeric comparison. This works fine on Linux systems. $ date -d '2015/12/31' +%s 1451538000 $ date +%s 1449159121 But we don't have -d option in HPUX. What would be... (5 Replies)
Discussion started by: veeresh_15
5 Replies

2. UNIX for Dummies Questions & Answers

Condition based on Timestamp (Date/Time based) from logfile (Epoch seconds)

Below is the sample logfile: Userids Date Time acb Checkout time: 2013-11-20 17:00 axy Checkout time: 2013-11-22 12:00 der Checkout time: 2013-11-17 17:00 xyz Checkout time: 2013-11-19 16:00 ddd Checkout time: 2013-11-21 16:00 aaa Checkout... (9 Replies)
Discussion started by: asjaiswal
9 Replies

3. Shell Programming and Scripting

Current triggered time to epoch seconds

I have a requirement to find long running instances for notifying the stake holders based on the triggered time in AIX. I am not sure how to convert the triggered time to epoch seconds. For example : Current triggered time of instance is 13:06:19 -> how to convert this into epoch in the... (5 Replies)
Discussion started by: chandu123
5 Replies

4. Shell Programming and Scripting

Adding Seconds to UNIX/Epoch-Time

Hello All, I have a Perl script I'm writing where I ask the user to enter a "start time" for something. The "$start_time" will be in the format of: # The Time CLI Option Can be in the format of: --start-time="1day" --start-time="2hours" --start-time="45min" ... (1 Reply)
Discussion started by: mrm5102
1 Replies

5. Shell Programming and Scripting

Date conversion from Standard/given format to seconds/epoch

I am trying get time difference of two dates in secs. Initially I want to convert a standard date format to epoch for two dates and then subtract the two epoch dates. Example : date -d "2007-09-01 17:30:40" '+%s' But this gives me below error date: illegal option -- d Usage: date OS: AIX... (6 Replies)
Discussion started by: bpaac
6 Replies

6. Shell Programming and Scripting

shell script that will automatically check if specifed user is log in or not, in 30 seconds

guys I need emergency help with below shell script assignment..am new to shell script Write a Shell script to automatically check that a specified user is logged in to the computer. The program should allow the person running the script to specify the name of the user to be checked, the... (2 Replies)
Discussion started by: gurmad
2 Replies

7. HP-UX

getting the "seconds since epoch" in HP-UX kernel

Hi! I'm writing a kernel module on HP-UX 11.23, and I can't find how to get the “number of seconds since epoch” (midnight of Jan 1st 1970). Actually I'm trying to find an equivalent to the user-space “time()” function... I found that in Linux, one can access “xtime.tv_sec” in the... (1 Reply)
Discussion started by: nati
1 Replies

8. Shell Programming and Scripting

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... (1 Reply)
Discussion started by: 12yearold
1 Replies

9. Shell Programming and Scripting

check the file every 15 seconds

Hi All, I need a script which does, script check a file every 15 second, if file not exist, it will create a log file. how can I do it ? thanks Alice (4 Replies)
Discussion started by: alisevA3
4 Replies

10. UNIX for Dummies Questions & Answers

Epoch

Hi all, i am trying to figure out how i can get a 'Nix box to display epoch time. Is there a command to do this? Do I know what I am talking about or am I an Idiot? Wait dont answer that last question!!!!! Thanx in advance!!!:confused: (2 Replies)
Discussion started by: Bodhi
2 Replies
Login or Register to Ask a Question