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

date to text formats - neverending story

P: n/a
Hi,

Very often I have a problem with date formats.
There are cases I have to cast the date to text and from text to date on a
different server. However, sometimes the date formats on the servers are
different and this doesn't always work. Also on my development environment
this is hard to detect, because here all the servers have the same date
format.

Is there any way of avoiding this problem programmatically, once and
forever, without setting all settings the same?

Thanks,

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


P: n/a
I'd make sure that whenever the date is being exchanged between systems you
just make sure its a date. That way if one server needs to turn it into
text, it can do it, but if it needs to sent a value to another server
(middle tier, or whatever) it always sends that value as a date.

This way you're passing around Quantified information (the VALUE of a date)
as opposed to a Qualified information (a String that represents a date for a
given culture and display format).
"Leo Muller" <le***@keshet-i.com> wrote in message
news:c6**********@news2.netvision.net.il...
Hi,

Very often I have a problem with date formats.
There are cases I have to cast the date to text and from text to date on a
different server. However, sometimes the date formats on the servers are
different and this doesn't always work. Also on my development environment
this is hard to detect, because here all the servers have the same date
format.

Is there any way of avoiding this problem programmatically, once and
forever, without setting all settings the same?

Thanks,

Leo

Nov 18 '05 #2

P: n/a
How would I do this if, for example, the end users has to type in a date (or
update), through a text field?

Leo

"David Jessee" <dj*****@houston.rr.com> wrote in message
news:O5**************@TK2MSFTNGP10.phx.gbl...
I'd make sure that whenever the date is being exchanged between systems you just make sure its a date. That way if one server needs to turn it into
text, it can do it, but if it needs to sent a value to another server
(middle tier, or whatever) it always sends that value as a date.

This way you're passing around Quantified information (the VALUE of a date) as opposed to a Qualified information (a String that represents a date for a given culture and display format).
"Leo Muller" <le***@keshet-i.com> wrote in message
news:c6**********@news2.netvision.net.il...
Hi,

Very often I have a problem with date formats.
There are cases I have to cast the date to text and from text to date on a different server. However, sometimes the date formats on the servers are
different and this doesn't always work. Also on my development environment this is hard to detect, because here all the servers have the same date
format.

Is there any way of avoiding this problem programmatically, once and
forever, without setting all settings the same?

Thanks,

Leo


Nov 18 '05 #3

P: n/a
guess you are showing the date format that end users have to type
(MM/DD/YYYY)
once you access the text value from text box convert it to the format you
need and check it satisfies.

use DateTime.Parse or ParseExact.

Av.

"Leo Muller" <le***@keshet-i.com> wrote in message
news:c6**********@news2.netvision.net.il...
How would I do this if, for example, the end users has to type in a date
(or
update), through a text field?

Leo

"David Jessee" <dj*****@houston.rr.com> wrote in message
news:O5**************@TK2MSFTNGP10.phx.gbl...
I'd make sure that whenever the date is being exchanged between systems

you
just make sure its a date. That way if one server needs to turn it into
text, it can do it, but if it needs to sent a value to another server
(middle tier, or whatever) it always sends that value as a date.

This way you're passing around Quantified information (the VALUE of a

date)
as opposed to a Qualified information (a String that represents a date
for

a
given culture and display format).
"Leo Muller" <le***@keshet-i.com> wrote in message
news:c6**********@news2.netvision.net.il...
> Hi,
>
> Very often I have a problem with date formats.
> There are cases I have to cast the date to text and from text to date
> on a > different server. However, sometimes the date formats on the servers
> are
> different and this doesn't always work. Also on my development environment > this is hard to detect, because here all the servers have the same date
> format.
>
> Is there any way of avoiding this problem programmatically, once and
> forever, without setting all settings the same?
>
> Thanks,
>
> Leo
>
>



Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.