date to text formats - neverending story

  • Thread starter Thread starter David Jessee
  • Start date Start date
D

David Jessee

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).
 
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
 
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.
 
How would I do this if, for example, the end users has to type in a date (or
update), through a text field?

Leo
 
Back
Top