Unix time problem

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...?
raj_papsAsked:
Who is Participating?
 
gheistConnect With a Mentor Commented:
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
 
sunnycoderCommented:
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
 
GnsCommented:
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
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
GnsCommented:
;-) gheist. On many unices the daemon-command/package is xntpd ... same thing.

-- Glenn
0
 
ahoffmannCommented:
please post results of:
  /bin/date
  /bin/date -u
0
 
TintinCommented:
24 hours =  1440 mins = 86400 seconds and

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

0
 
gheistCommented:
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
 
gheistCommented:
86401=7*12343 i.e divisible
0
 
GnsCommented:
> 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.