By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,361 Members | 2,131 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,361 IT Pros & Developers. It's quick & easy.

DateTime trouble

P: n/a
Hi.
I can't figure out how to solve this problem, so if anyone here can help me
I will be forever grateful.
I have a web application, which is placed on two different servers. One of
the servers has the following date and time formatting set in regional
options in the control panel:
Date: dd.MM.yyyy Time: HH:mm:ss
The other one has this formatting:
M/dd/yyyy H:mm:ss

Now, I'm getting a date out of my DB. Not a date and a time, just the date.
I've specified it to be on this format: dd.MM.yyyy
This is what causes the problem, because the second server doesn't recognize
it as a valid date. How can I make the server recognize it as a valid date
without changing the regional options?

Thanks,
Shawn

Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
How does your datetime data flows from one server to another server
What's the code causes problem?
Nov 18 '05 #2

P: n/a
Are you passing the date out of your DB as a string? Can you keep it as a
date instead? Otherwise, you may have to parse it yourself based on the
local settings. You could also try date.parse to see if it will do what you
want.

"Shawn" <bo********@hotmail.com> wrote in message
news:40********@news.wineasy.se...
Hi.
I can't figure out how to solve this problem, so if anyone here can help me I will be forever grateful.
I have a web application, which is placed on two different servers. One of
the servers has the following date and time formatting set in regional
options in the control panel:
Date: dd.MM.yyyy Time: HH:mm:ss
The other one has this formatting:
M/dd/yyyy H:mm:ss

Now, I'm getting a date out of my DB. Not a date and a time, just the date. I've specified it to be on this format: dd.MM.yyyy
This is what causes the problem, because the second server doesn't recognize it as a valid date. How can I make the server recognize it as a valid date
without changing the regional options?

Thanks,
Shawn

Nov 18 '05 #3

P: n/a
Yes the date is passed out as a string. I cannot keep it as a date unless I
want it to be passed out according to the date time format in Regional
Options.

I've tried just about everything. Date.Parse causes an exception because
the server doesn't recognize dd.MM.yyyy as a valid date.

Do you know how I get the date time formatting used by the system? Is there
a method or a property somewhere that will return, in this case, M/dd/yyyy
H:mm:ss ?

Shawn
"Rick Spiewak" <ri*********@mindspring.com> wrote in message
news:OX**************@tk2msftngp13.phx.gbl...
Are you passing the date out of your DB as a string? Can you keep it as a
date instead? Otherwise, you may have to parse it yourself based on the
local settings. You could also try date.parse to see if it will do what you
want.

"Shawn" <bo********@hotmail.com> wrote in message
news:40********@news.wineasy.se...
Hi.
I can't figure out how to solve this problem, so if anyone here can help me I will be forever grateful.
I have a web application, which is placed on two different servers. One of
the servers has the following date and time formatting set in regional
options in the control panel:
Date: dd.MM.yyyy Time: HH:mm:ss
The other one has this formatting:
M/dd/yyyy H:mm:ss

Now, I'm getting a date out of my DB. Not a date and a time, just the date. I've specified it to be on this format: dd.MM.yyyy
This is what causes the problem, because the second server doesn't recognize it as a valid date. How can I make the server recognize it as a valid date
without changing the regional options?

Thanks,
Shawn


Nov 18 '05 #4

P: n/a
Never mind.. Insted of selecting the date using the date format I wanted to
show in my application, I selected it in it's native format and showed it in
my application using date.tostring("dd.MM.yyyy"). That way the system
recognized it as a date and I could perform datetime operations on it.

Shawn
"Shawn" <bo********@hotmail.com> wrote in message
news:40********@news.wineasy.se...
Hi.
I can't figure out how to solve this problem, so if anyone here can help me I will be forever grateful.
I have a web application, which is placed on two different servers. One of
the servers has the following date and time formatting set in regional
options in the control panel:
Date: dd.MM.yyyy Time: HH:mm:ss
The other one has this formatting:
M/dd/yyyy H:mm:ss

Now, I'm getting a date out of my DB. Not a date and a time, just the date. I've specified it to be on this format: dd.MM.yyyy
This is what causes the problem, because the second server doesn't recognize it as a valid date. How can I make the server recognize it as a valid date
without changing the regional options?

Thanks,
Shawn

Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.