Last post Sep 14, 2007 07:07 AM by andersbohlin
Sep 13, 2007 11:27 AM|andersbohlin|LINK
this is probably a stupid question, but here goes anyway
is there any way i can override the datetime class?
what i wish to accomplish is at any variable of the type datetime have a custom function, like:
dim dt as datetime = now()
response.write(dt.ToLocalTime) or even response.write(now.ToLocalTime)
something like that, otherwise i would have to pass it through a function, wich ofcourse i can, but it would be easier if i could have a custom function.
what im trying is to let the user select his own timezone and then in an easy way apply this to all dates displayed on the webpage,
ive searched everywhere and the best i could find uses a function to return the custom date, nothing with just applying it to a culture or something like that so that every date automatically would be converted...
can anyone give me some assistance here?
Sep 13, 2007 11:48 AM|jguadagno|LINK
I do not think you can override the DateTime because it is a hybrid class / struct. Your best bet is to have a separate TimeZone class.
Sep 14, 2007 07:07 AM|andersbohlin|LINK