?
Solved

Unix time problem

Posted on 2004-04-06
9
Medium Priority
?
401 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 750 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

765 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