Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Weird date problem!

Reply
Thread Tools

Weird date problem!

 
 
Mark
Guest
Posts: n/a
 
      01-22-2006
Hi, I have a date / time in the following format

1/25/2006 8:00:00 AM

When I do the following on my local server Convert.ToDateTime('1/25/2006
8:00:00 AM') I get 1/25/2006 8:00:00 AM which is fine..

However, when I upload the code to my server in the states and do the same
thing Convert.ToDateTime('1/25/2006 8:00:00 AM') I get
1/25/2006 5:00:00 AM

Does anyone have any idea *why* this is happening?? I am using ASP.NET 2.0

Thanks
Mark


 
Reply With Quote
 
 
 
 
EJD
Guest
Posts: n/a
 
      01-22-2006
Mark,
It looks that you're passing a string value to the Convert.DateTime,
and that value should not differ even if the code was executed in a
different time zone which it seems is the case with your situation.
AFAIK. However, if the value passed to the Convert was coming from a
call to DateTime.Now() then I guess you would see different values in
different time zones unless the DateTimeKind has been specified (to
local or UTC)... And servers by default use UTC to keep track of time
but all of what I've said is irrelevant if you're just passing a string
to the Convert...
Hope this helps.
Eric

 
Reply With Quote
 
 
 
 
Mark
Guest
Posts: n/a
 
      01-22-2006
Hi Eric, thanks for your help.

Yeah, I coud understand it if I was just going DateTime.Now() on a local
server and then did the same thing on a remote server but this has me
baffled...

Thanks again
Mark

"EJD" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Mark,
> It looks that you're passing a string value to the Convert.DateTime,
> and that value should not differ even if the code was executed in a
> different time zone which it seems is the case with your situation.
> AFAIK. However, if the value passed to the Convert was coming from a
> call to DateTime.Now() then I guess you would see different values in
> different time zones unless the DateTimeKind has been specified (to
> local or UTC)... And servers by default use UTC to keep track of time
> but all of what I've said is irrelevant if you're just passing a string
> to the Convert...
> Hope this helps.
> Eric
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP General 11 11-08-2003 11:24 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP .Net 1 11-08-2003 09:14 PM
Given a date, how to find the beginning date and ending date of that week Matt C Programming 3 11-08-2003 09:07 PM
Given a date, how to find the beginning date and ending date of that week Matt C++ 2 11-08-2003 08:30 PM



Advertisments