We are on the w
is "2004-26",
My question is how can I get the first sunday of w
change string "2004-26" into a DateTime variable with the value of first
sunday of w
Kind regards
Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.comThe easiest way I could think of would be to check what the first day of the
year is (1/1/2004) through the DayOfW
calculate the offset between it and the previous Sunday.
For 2004, calling DateTime.DayOfW
Therefore, the first w
12/28/2003. To determine the Sunday starting any given w
could simply calculate it via:
public DateTime GetW
{
return FirstSundayOfYear.AddDays(7*(W
}
The rationale for (W
be set to 12/28/2003 so if you were looking for w
to add 0 days as opposed to 7.
You indicated that you wanted to convert a string (2004-26) into a DateTime
for the first sunday of each w
scenario since obviously no direct conversion exists would be to define a
W
the key of the key to the desired string and the value to the appropriate
DateTime value.
Hope this helps!
"Guoqi Zheng" <no@.sorry.nl> wrote in message
news:uIdNKvDXEHA.128@.TK2MSFTNGP10.phx.gbl...
> Dear sir,
> We are on the w
w
> is "2004-26",
> My question is how can I get the first sunday of w
> change string "2004-26" into a DateTime variable with the value of first
> sunday of w
> --
> Kind regards
> Guoqi Zheng
> guoqi AT meetholland dot com
> Http://www.meetholland.com
>
>
0 comments:
Post a Comment