Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Time::Set(int64 scalar) unexpected results
Re: Time::Set(int64 scalar) unexpected results [message #40735 is a reply to message #40733] Tue, 10 September 2013 21:04 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1791
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Alboni wrote on Tue, 10 September 2013 20:54

time_t can be both 32 or 64 bit
Yes, it is implementation defined. It doesn't even have to start at 1970 Smile :
http://en.cppreference.com/w/c/chrono/time_t

Arithmetic type capable of representing times.
Although not defined, this is almost always a integral value holding the number of seconds (not counting leap seconds) since 00:00, Jan 1 1970 UTC, corresponding to POSIX time.
So it would be safer not to rely on it too much, especially if you want the app to be platform independent.

Alboni wrote on Tue, 10 September 2013 20:54

and the rest work ok. just not the year.
All the years are quite similar, unless it is a leap year. I'd say that just changing the year after using Time::Set() with timestamp might mess up something due to the complex rules of leap days (see Date::Set(int64) to get an idea how complex this stuff is Wink ).

Honza

[Updated on: Tue, 10 September 2013 21:04]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Core/SSL change to let MinGW
Next Topic: Binary file to JSON
Goto Forum:
  


Current Time: Sun Apr 27 21:15:43 CEST 2025

Total time taken to generate the page: 0.04044 seconds