DataReader.GetDateTime

C

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
 
W

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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top