lundi 2 janvier 2017

Is there any efficient way to generate random date_time from range to 10 days back from now?

I wanted to know if there is any possible way to to generate random posix::time from range of now to 10 days back ?

I thought about something like:

using namespace boost::posix_time;
second_clock now = second_clock::local_time();
second_clock back = now - hours(240);

Doing so I would have local date and date from 10 days back, but how could I generate some random date from that period ? I know that's probably as easy as it could be, but I am out of ideas ;/

Aucun commentaire:

Enregistrer un commentaire