wxDateTime 'invalid value'

Armel Asselin asselin.armel at wanadoo.fr
Tue Jan 23 07:17:56 PST 2007


Hello all [late happy new year :)],

i'm currently trying to use wxDateTime to represent dates which are input 
from scripts (which I test wrt to a somewhat standard test suite).
I'm confronted to this problem:
wxDateTime() { m_time = wxLongLong((long)ULONG_MAX, ULONG_MAX); }

it seems that the "invalid" date is rather poorly chosen because this date 
is also the date 1969/12/31 23:59:59.999 which is in the range of dates and 
times handled by wxDateTime.

could we use m_time = wxLongLong((long)(ULONG_MAX-(ULONG_MAX>>1)), 0) as 
"invalid" value?
it is basically the largest negative value which can be coded on a 
wxLongLong, and this value is indeed -not- in the range of dates handled by 
wxDateTime.

Best regards,
Armel Asselin






More information about the wx-dev mailing list