Local_date_time constructor question

Documentation for local_date_time constructor local_date_time(...) Parameters: date time_duration time_zone_ptr bool states that the last parameter, "The DST flag", "must be passed to indicate whether the time is in daylight savings or not." My question is: Isn't the combination of the first parameter, "date" and third parameter, "time_zone_ptr" determine if the resulted local_date_time will be either in the daylight saving time period or not?

I do not believe date and time zone will tell you if the area is in day light savings or not. Because there are some areas that do not observe daylight savings. In the US, I know that Arizona is part of Mountain Time for the time zone, but they do not observe day light savings. Moreover, there are many countries throughout the world that do not do day light savings. There's a pretty good map that illustrates areas that do and do not observe daylight savings at: http://en.wikipedia.org/wiki/Daylight_saving_time On 1/4/2011 3:48 PM, qplace wrote:
Documentation for local_date_time constructor local_date_time(...) Parameters: date time_duration time_zone_ptr bool
states that the last parameter, "The DST flag", "must be passed to indicate whether the time is in daylight savings or not."
My question is:
Isn't the combination of the first parameter, "date" and third parameter, "time_zone_ptr" determine if the resulted local_date_time will be either in the daylight saving time period or not?
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- 2 much txting mks u 1 bad splr!!!!

John Rocha
I do not believe date and time zone will tell you if the area is in day
light
savings or not. Because there are some areas that do not observe daylight savings. In the US, I know that Arizona is part of Mountain Time for the time zone, but they do not observe day light savings.
time_zone support in datetime library covers usage of DST extensively. Every timezone in datetime library can be defined with or without usage of DST. Since time_zone is one of the parameters to the constructor it carries DST information by definition. The actual reason for me to ask my question here was the exception caused by the conflict between this forth parameter and the DST settings that I was using in my timezone. Since then I moved to a another constructor, but the question remains - why do we have to supply the forth parameter when the timezone parameter defines usage of DST.

On Wed, 2011-01-05 at 19:10 +0200, qplace wrote:
time_zone support in datetime library covers usage of DST extensively. Every timezone in datetime library can be defined with or without usage of DST. Since time_zone is one of the parameters to the constructor it carries DST information by definition. The actual reason for me to ask my question here was the exception caused by the conflict between this forth parameter and the DST settings that I was using in my timezone. Since then I moved to a another constructor, but the question remains - why do we have to supply the forth parameter when the timezone parameter defines usage of DST.
The constructor documentation states: The passed time information understood to be in the passed tz. The DST flag is calculated according to the specified rule. May throw a ambiguous_result or time_label_invalid exception. By applying DST rules you may get the same local time twice in a year, hence you need to specify whether DST was active or not to fully determine the respective UTC time. Avoid the mentioned constructor unless you have all the necessary information at hand. --> Mika Heiskanen
participants (3)
-
John Rocha
-
Mika Heiskanen
-
qplace