473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Weird date problem!

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
Jan 22 '06 #1
2 954
EJD
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

Jan 22 '06 #2
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" <jp******@hotmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro 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

Jan 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: NanQuan | last post by:
I'm hoping someone can help me solve this error since I am at a total loss here. Usually I don't bother posting on any forums or groups on the internet and prefer to solve stuff myself but this is...
3
by: modemer | last post by:
Hello, I got weird compiling message similar like following when I compiled my simple code on Sun 5.8 with CC WorkShop 6 update 2 C++ 5.3. CC -g -o myclass.o -c myclass.cpp CC -g -o main.o...
5
by: John Kiernan | last post by:
Hey JavaScript gurus! Here's a weird one: If I check (with an alert) this line: vStrDate2 = vDate.toLocaleString(); I get: Saturday, August 14, 2004 7:57:30 PM (as I should) but this...
2
by: andybriggs | last post by:
An Access 97 database is running quite happily on about 30 IBM ThinkPads. Some of the users, however, have now installed some components of Office 2000 like Word and Excel. On those machines, the...
5
by: Coleen | last post by:
Hi all :-) I have a bit of code that chacks for the last day of the Month, and if it falls on a week-end, sets the due date to the Monday after... I'm trying to get the date to go to the...
2
by: Bill Nguyen | last post by:
Every time I jumped to a new month, the app kept popping up the message box for subsequent months until 2050! If I stayed within the same month (current month), it worked fine. Please take a look...
2
by: sherifffruitfly | last post by:
Hi, I'm using an adaptation of excel-reading code that's all over the internet - I don't much like or understand it, but it has worked for me in the past.... beggars can't be choosers... : ...
11
by: Killer42 | last post by:
Hi all. Short version: DtPicker goes strange when .Enabled changed in VBA code, looking for solution or good workaround. Looooong version: Those of you who have been following various threads...
20
by: ongaro.admin | last post by:
Hi, I'm experiencing a strange problem with .mdb files. We have two buildings connected by optical fiber (a single LAN). Everything works perfect with any file, any size, any application...
1
by: cjordan | last post by:
Hi everyone. I'm new here, and I think I've got a pretty unique problem (haven't found any solution to this anywhere else), but I'm hoping that someone here can help me. To be honest, I'm not a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.