Solved

Unix time problem

Posted on 2004-04-06
9
398 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 62

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Expert Comment

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

-- Glenn
0
 
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 62

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 62

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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

696 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