Solved

Unix time problem

Posted on 2004-04-06
9
358 Views
Last Modified: 2010-04-21
I am using Unix time system. A full day (i.e 24 hrs) is not divisible by 60*60*24 seconds. System time is  5.30 hrs behind a multiple of 24 hrs (60*60*24).

Is it because of the GMT difference or is it because of Unix time is measured relative of 5.30 hrs...?
0
Comment
Question by:raj_paps
9 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10772050
Hi raj_paps,

> A full day (i.e 24 hrs) is not divisible by 60*60*24 seconds. System time is  5.30 hrs behind
> a multiple of 24 hrs
Not sure what you mean by this ... How did you determine this

To me it seems that you are locatd in India or some closeby location and are having a system time of +5:30 GMT

Sunnycoder
0
 
LVL 20

Expert Comment

by:Gns
ID: 10774713
Yup... Are we looking at gmtime or localtime results?

Or are you refering to the result of the date command? (This'd probably indicate some problem with euither time as such, or with the timezone setup... In which case one should mention ntp. ntp:-).

-- Glenn
0
 
LVL 61

Accepted Solution

by:
gheist earned 250 total points
ID: 10774921
try date -u for UTC time, if this seems wrong ntp...ntp...ntp:-) (www.ntp.org has instructions, software may be already on system, # ntpdate public.time.server for short)
0
 
LVL 20

Expert Comment

by:Gns
ID: 10775300
;-) gheist. On many unices the daemon-command/package is xntpd ... same thing.

-- Glenn
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 10777420
please post results of:
  /bin/date
  /bin/date -u
0
 
LVL 48

Expert Comment

by:Tintin
ID: 10779316
24 hours =  1440 mins = 86400 seconds and

86400 / (60*60*24) = 1, so in fact it is divisible.

0
 
LVL 61

Expert Comment

by:gheist
ID: 10780951
Gns: yes, x* is v3 n* is v4, ntpdate is for both.

Some days are one second longer, this is 60th second in last minute of day and second is called "leap second".
One in four years has february 29, not sure how it is called english.
One in hundred years has no Feb 29
One in four hundred years (1600,2000, ....) again has Feb 29

International time institution is in Paris, France, not in Greenwich, England
0
 
LVL 61

Expert Comment

by:gheist
ID: 10780959
86401=7*12343 i.e divisible
0
 
LVL 20

Expert Comment

by:Gns
ID: 10781715
> Gns: yes, x* is v3 n* is v4, ntpdate is for both.
Was just a clarification, if raj_paps goes looking for ntp* and only find ntpdate;). Some unices "only" package v3... Or have let their package name/executables retain the v3 names. One can of course get the real deal from the link you mention:-).

Oh and the words you're looking for might be "modulo" or the phrase "evenly divisible by", althoug I (as a swede != anglophone:-) have no trouble understanding your excellent explanation fo leapday calculation;). Not that I really can see where that would come into play here... Leapsecond might, but perhaps not leapday.
I'd guess we're looking at something simple... Like a wrong setting for timezone (not keeping time in UTC... Urgh), or even more probable: using the wrong function to get the localized time.

> International time institution is in Paris, France, not in Greenwich, England
Sure ... and that perhaps explains why "universal coordinated time" gets to be UTC (nah, I don't have any preconcieved opinions on french mentality:-). However one looks upon it, the notion of time standardization has its roots in Greenwich though ..:-):-)

Anyway, we're drifting here. We really need some context for this question.

-- Glenn
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now