|
From: Dirk E. <ed...@de...> - 2009-04-18 02:22:25
|
In ql/time/date.cpp we have
Date Date::todaysDate() {
std::time_t t;
if (std::time(&t) == std::time_t(-1)) // -1 means time() didn't work
return Date();
std::tm *gt = std::gmtime(&t);
return Date(Day(gt->tm_mday),
Month(gt->tm_mon+1),
Year(gt->tm_year+1900));
}
I'd like to be able to use std::localtime instead as I just got bitten when I
asked for todaysDate() here in UTC+6 and got tomorrow's date instead.
Shall I add that with a binary toggle to turn localtime on/off with a default
to off, i.e. existing behaviour?
Other suggestions? I'd also love a Date() constructor from "yyyymmdd" or
(long) yyyymmdd as just relying on the Applix/Excel number is a tad
restrictive.
Dirk
--
Three out of two people have difficulties with fractions.
|