How to Understand the UNIX Time Format?


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat How to Understand the UNIX Time Format?
# 1  
Old 06-12-2014
BSD How to Understand the UNIX Time Format?

How to understand the unix time format as here i have pasted this is a unix time 1402565420 and its 3:00 PM here but its give this Output as long number How can i make it to understand format as i have 3:00 PM

Normal time format <----3:00PM = 1402565420----> Unix Time
Will Any one Explain to understand this . Thanks.

Last edited by babinlonston; 06-12-2014 at 06:38 AM.. Reason: spell mistake
# 2  
Old 06-12-2014
Unix time (aka POSIX time or Epoch time), is defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970,[1][note 1] not counting leap seconds.[1][2][note 2] It is used widely in Unix-like and many other operating systems and file formats. Example: 1402502196

and 3:00 PM is your system time.
you can get system time using command.
date +%H:%MI

These two times dont have any connection.
This User Gave Thanks to Makarand Dodmis For This Post:
# 3  
Old 06-12-2014
Wow Cool, Then i have to Divide the Seconds to get the Right Answer .

1 Day = 86400 Seconds
1 Year = 31449600 Seconds

2014-1970 = 44 years

31449600 x 44 years = 1383782400

Some of 6 Months not added here, Cool thanks a lot Makarand Dodmis
# 4  
Old 06-12-2014
Note that one year is either 31449600 or 31622400 seconds due to leap years extra day.
This User Gave Thanks to jlliagre For This Post:
# 5  
Old 06-12-2014
Thanks for that Jilliagre, yes you right .
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Arduino UNIX Time - Syncing Computer UNIX Time to Arduino Time with Python

Just finished a quick Python script to send the current unix time over to the Arduino from macOS, so in the absence of GPS or some other way to get the unix timestamp (epoch time) to the Arduino, I can get my macOS and Arduino UNO synced to within a second. Normally, when the Arduino starts... (9 Replies)
Discussion started by: Neo
9 Replies

2. Shell Programming and Scripting

Calculate Time diff in milli milliseconds(Time format : HH:MM:SS,NNN)

Hi All, I have one file which contains time for request and response. I want to calculate time difference in milliseconds for each line. This file can contain 10K lines. Sample file with 4 lines. for first line. Request Time: 15:23:45,255 Response Time: 15:23:45,258 Time diff... (6 Replies)
Discussion started by: Raza Ali
6 Replies

3. Shell Programming and Scripting

Change the date and time format in UNIX script.

Hi, I am extracting a date string from the source file like this : 06/05/2014 16:04:00 I want to change it to 05-JUN-14 04.05.00.000000000 PM I basically store the date in a variable. I got solutions to change date in dd-mmm-yyyy format using tr but I guess it works only with the "date"... (8 Replies)
Discussion started by: Varshha
8 Replies

4. Shell Programming and Scripting

Changing the format of the unix time command

Hello. I use time in order to calculate the execution time of a program. The output format is: real 0m0.059s user 0m0.028s sys 0m0.004s Is there a simple and elegant way to add user and sys together, and convert to milliseconds? Thanks a lot! (4 Replies)
Discussion started by: dynelight
4 Replies

5. Shell Programming and Scripting

Converting windows format file to unix format using script

Hi, I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix. My requirement here is that i want to do it automatically using a... (5 Replies)
Discussion started by: sarbjit
5 Replies

6. Shell Programming and Scripting

Help: transform unix time format to standard

Hello All, Do you have any idea, how can I transform the unix time format to standard: time_last_login=1268057983 :confused: I would like to use the transformation in a AIX shell script :( (6 Replies)
Discussion started by: kalaso
6 Replies

7. Shell Programming and Scripting

Retaining the Unix CSV format in Excel format while exporting

Hi All, I have created a Unix Shell script whch creates a *.csv file and export it to Excel. The problem i am facing is that Users wants one of the AMOUNT field in comma separted values. Example : if the Amount has the value as 3000000 User wants to be in 3,000,000 format. This Amount format... (2 Replies)
Discussion started by: rawat_me01
2 Replies

8. Shell Programming and Scripting

Script to capture date/time in seconds in PERL... Cant understand errors

I'm Using this script to find the time of a file. I'm very much new to PERL and found this script posted by some one on this forum. It runs perfectly fine, just that it gives me following errors with the accurate output as well. I jus want the output to be stored in another file so that i can... (0 Replies)
Discussion started by: bankimmehta
0 Replies

9. Shell Programming and Scripting

Convert Epoch time format to normal date time format in the same file

I have a file named "suspected" with series of line like these : {'protocol': 17, 'service': 'BitTorrent KRPC', 'server': '219.78.120.166', 'client_port': 52044, 'client': '10.64.68.44', 'server_port': 8291, 'time': 1226506312L, 'serverhostname': ''} {'protocol': 17, 'service': 'BitTorrent... (3 Replies)
Discussion started by: rk4k
3 Replies

10. Windows & DOS: Issues & Discussions

conversion of unix time format

help me to convert unix time format into windows time format using java i have linux time ex. 1075329297.572 (2 Replies)
Discussion started by: sari
2 Replies
Login or Register to Ask a Question