Add OSystem::getTimeAndDate API
|Reported by:||fingolfin||Owned by:||sev-|
The attached patch adds a new OSystem::getTimeAndDate method, which does basically what its name suggests: It returnes the current time and date, as time()+localtime() would yield on a POSIX system.
For simplicity, I just used the struct tm from time.h (which *is* part of the C standard) for the return value. But we could just as well define our own Common::Time struct for this, if preferred.
The benefit of this patch is that it reduces (removes?) the need to ever use time/localtime, which are not very portable. In particular, it might help fix (and help avoid similiar issues in the future) bug #1834822 ( WINCE: Save games have incorrect time & date). The PS2 port would also benefit (see patch).
It's a very simple & straight forward patch, we could IMO push it to SVN right now. But since we are in a feature freeze, I'll await Eugene's comment. And I'll be happy to postpone this till after the release, too.
Ticket imported from: #1859448. Ticket imported from: patches/870.