wxDefaultDateTime.IsValid() == false

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Knows some wx things
Knows some wx things
Posts: 26
Joined: Fri Aug 07, 2015 2:09 pm

wxDefaultDateTime.IsValid() == false

Post by mybofy » Fri Feb 01, 2019 4:30 pm


wxwidgets 3.1.2

Why "wxDefaultDateTime.IsValid()" is always false ?

Value of wxDefaultDateTime is : 292278994-08-16_17-47-04 !!!


Part Of The Furniture
Part Of The Furniture
Posts: 3351
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxDefaultDateTime.IsValid() == false

Post by ONEEYEMAN » Fri Feb 01, 2019 4:51 pm

Because datetime object has to be initialized with either calling Now() or by some other means.

Its very easy and cheap to do

Code: Select all

wxDateTime dt = wxDateTime::Now();
as it just calls the CRT function.

Thank you.

Post Reply