#8765 closed patch
Add OSystem::getTimeAndDate API
Reported by: | fingolfin | Owned by: | sev- |
---|---|---|---|
Priority: | normal | Component: | --Other-- |
Version: | Keywords: | ||
Cc: | Game: |
Description
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.
Attachments (1)
Change History (5)
by , 17 years ago
Attachment: | curtime.patch added |
---|
comment:1 by , 17 years ago
Status: | new → closed |
---|
comment:2 by , 17 years ago
comment:3 by , 17 years ago
implemented it in commits 30083, 30084. simplifies things a lot. thanks :-)
comment:4 by , 6 years ago
Component: | → --Other-- |
---|
Definitely it could help Kostas. Committed to both branch and trunk