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 » Date is broken for years below one.
Date is broken for years below one. [message #26542] Mon, 10 May 2010 16:06 Go to previous message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
const Date date1(0, 1, 1);
ASSERT(date1.IsValid());
const int n = date1.Get();

Date date2;
date2.Set(n);

ASSERT(date1 == date2);


I couldn't find description of an algorithm used in UPP, but other libraries (like BOOST) use Julian Day Number to convert date to a number of days. Algorithm for calculation seems to be much simpler in this case.

http://beta.boost.org/doc/libs/1_42_0/boost/date_time/gregor ian_calendar.ipp

http://www.faqs.org/faqs/calendars/faq/part2/

http://en.wikipedia.org/wiki/Julian_day


Regards,
Novo
 
Read Message
Read Message
Previous Topic: FileMove behaviour
Next Topic: Value<int64> and Value<int> mess
Goto Forum:
  


Current Time: Fri May 10 11:52:47 CEST 2024

Total time taken to generate the page: 0.02710 seconds