Home All Groups Group Topic Archive Search About
Author
26 Oct 2006 11:41 PM
David Thielen
Hi;

When I get a DateTime object from DataReader.GetDateTime() - what TimeZone
is it set to?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm

Author
27 Oct 2006 4:00 AM
Cor Ligthert [MVP]
David,

Normally none, however if there is a discrepant between the zone settings
from your server and your clients, than you have to take actions.

Cor

Show quote
"David Thielen" <thielen@nospam.nospam> schreef in bericht
news:6B418315-05C5-43F1-8F24-D1E7E8241524@microsoft.com...
> Hi;
>
> When I get a DateTime object from DataReader.GetDateTime() - what TimeZone
> is it set to?
>
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
>
> Cubicle Wars - http://www.windwardreports.com/film.htm
>
>
Author
27 Oct 2006 9:40 AM
WenYuan Wang
Hi Dave
Thanks for Cor's reply.

First of all, I'd like to confirm my understanding of your issue.
According to your description, I understand that you want to know what
TimeZone is set to DateTime object which is returned by
DataReader.GetDataTime().
If I misunderstood anything here, please don't hesitate to correct me.

The DataTime object retuned by DataReader.GetDataTime() have no TimeZone
information.
DataReader.GetDateTime() method will do following step to return a DateTime
object.
1st, It will get the value from Database
2nd, and then convert it to DayPart and TimePart.
3rd, use DayPart and TimePart to create a ticks.
At last, return a DateTime object by new DateTime(ticks).

For the reason I mentioned above, the DataTime object have not the TimeZone
information.
None TimeZone is set to the DataTime object.

But if your server and your clients are in the different Time Zone, as Cor
said, some task should be done to convert time from server to client.

I also noticed that you have posted some posts very closed to this issue in
the microsoft.public.dotnet.framework.aspnet forum.
The engineer in that forum would give you more information about how to
convert the time in ASP.net.
Thanks,

If anything is unclear, please don't hesitate to post in the newsgroup and
we will follow up.
Wen Yuan
===============================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
===============================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

AddThis Social Bookmark Button