?
Solved

Unix time problem

Posted on 2004-04-06
9
Medium Priority
?
413 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 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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

750 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