date to text formats - neverending story

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).
 
L

Leo Muller

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
 
A

avnrao

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.
 
L

Leo Muller

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

Leo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top