R
Robm
Since googling this issue only brings up the April fool's problem, which was
solved years ago, I hope that somebody can help me with this. I have a large
vc++/mfc application which needs to know when DST is in effect. This has
been working fine for years, but I am worried about the upcoming change in
2007 in the US, which will be followed by a number of Canadian provices
(where my application is used). The function that I use is very simple, as
shown below, but I doubt very much that this will still work in 2007. I
especially doubt that this will still work for both NB and NS, two provices
in the same timezone, but NB will follow the US, while NS may not.
BOOL CPortView::isdst(time_t tim)
{
int ret=0;
struct tm *tmp;
if(_daylight){
tmp=localtime(&tim);
ret=tmp->tm_isdst;
}
return(ret?TRUE:FALSE);
}
In the Windows OS, you can pick a timezone, and you can set if DST is to be
used, but you can't set the rules for it. So how is this supposed to work?
Any and all comments are appreciated. Apologies if this is not the proper
newsgroup.
Rob M
solved years ago, I hope that somebody can help me with this. I have a large
vc++/mfc application which needs to know when DST is in effect. This has
been working fine for years, but I am worried about the upcoming change in
2007 in the US, which will be followed by a number of Canadian provices
(where my application is used). The function that I use is very simple, as
shown below, but I doubt very much that this will still work in 2007. I
especially doubt that this will still work for both NB and NS, two provices
in the same timezone, but NB will follow the US, while NS may not.
BOOL CPortView::isdst(time_t tim)
{
int ret=0;
struct tm *tmp;
if(_daylight){
tmp=localtime(&tim);
ret=tmp->tm_isdst;
}
return(ret?TRUE:FALSE);
}
In the Windows OS, you can pick a timezone, and you can set if DST is to be
used, but you can't set the rules for it. So how is this supposed to work?
Any and all comments are appreciated. Apologies if this is not the proper
newsgroup.
Rob M