Skip to main content
gamedev.net
🔒 Locked

Date comparisons

Started by HukedOnFoniks 0 replies 200+ views
Original Post
HukedOnFoniks
HukedOnFoniks
Ok here''s my issue- I have a program where specific dates are stored in an array. What I need to do is take the system date and see if 90 days have elapsed. If so, I need to remove that date from the array and move everything forward. The major problem I''m having is determining the number of days between date a (the stored date) and date b (the current system date). Can anyone point me in the right direction or provide me some code to go by? Thanks in advance
civguy
civguy
Boost Date-Time Library.

Something like this should work then:

  
using namespace boost::gregorian;
date begin(2002,Feb,1);
date end(2002,Feb,7);
if ((end - begin).days() == 90) {
std::cout << "okay, remove this one!\n";
}

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.