Fedora Linux Support Community & Resources Center
Old 27th January 2012, 09:45 PM
mdberger Offline
Registered User
Join Date: Oct 2011
Posts: 64
Time Discrepency

On F16_64 in a complex C++ program, I first check the time with:

timespec ts_;

and get:

A little later I check with:

time_t timeI;

and get:

Earlier! So what's happening?

Thanks for your help.
Reply With Quote
Old 28th January 2012, 02:09 AM
sea Offline
"Shells" (of a sub world)
Join Date: May 2011
Location: Confoederatio Helvetica (Swissh)
Age: 37
Posts: 4,277
Re: Time Discrepency

Living in a country which switches the dayhours by 1 for winter and summer time, i'd guess one command get 'summertime' and the other reads the 'wintertime'.

Beeing confused?
One time is stored in bios, the other is displayed from system (whatever it may be), which stores your timezone and the according +/-X hr.
It then calculates the 'proper' time according to your settings done during installation.

My question to you is, why read the same value in 2 diffrent ways?
EFI Cheatsheet :: http://forums.fedoraforum.org/showthread.php?t=298546
Video Handler Script (VHS) (mass re-encode videos, screenrecorder, console music/webradio player, ...) :: http://forums.fedoraforum.org/showthread.php?t=299182
Windows 8+ & Fedora 20+ Dualboot :: http://forums.fedoraforum.org/showthread.php?t=298161
Reply With Quote
Old 28th January 2012, 02:42 AM
mdberger Offline
Registered User
Join Date: Oct 2011
Posts: 64
Re: Time Discrepency

Summer vs. Winter? I don't think so; the difference is less than a second.

Why to I use two different time methods? Well first of all, I don't anymore,
so that problem is gone. On the other hand, one method provides nanoseconds,
and the other provides only seconds. I would think that where the high precision
is not required, the one that provides seconds would do; but I would expect
the seconds to be the same as the seconds part of the higher precision method.
I consider this failure a system bug.

I find it hard to believe that one queries the system, and the other queries
the bios. If this is true, that this in itself looks like a design error. On the
other hand, the higher precision requires specification of a clock
clock_gettime(CLOCK_REALTIME) which man says returns the time since
the epoch. man 3 time says the same thing for time, but I don't see
anything there about CLOCK_REALTIME. Perhaps it is some other clock?

Reply With Quote

discrepency, time

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The system date and time is changing automatically, even after I set the correct time siva Using Fedora 8 31st July 2010 03:07 PM
Fedora 8 dual boot with Windows XP [Pavilion dv6137tx] Time gets reset every time! maverick280857 Hardware & Laptops 5 23rd March 2008 11:48 AM
FC5 light blue stripes all over the desktop from time to time paidopoieo Using Fedora 4 10th May 2006 04:36 PM

Current GMT-time: 12:05 (Wednesday, 23-08-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat