Best way to handle date on different PCs...
Posted on 2007-07-25
I am running VB.Net writing/reading to an Access 2003 database.
Alright, being new to programming I have come to the realization that I dont like Dates in any form or fashion. I thought I had it all figured out and was validating/saving/retrieving date just fine. And then I installed my compiled program on a clean PC and found a huge problem.
On my PC (and my test PC) I have my short date set to MM/DD/YYYY. And life is good and everything flows. We installed this on a different PC that had the short date set to M/D/YY and everything went down hill really fast. With error messages, invalid format errors etc.
I am saving my data with a masked text box and validating that it is in MM/DD/YYYY format when I save. But if someone has a PC with the date setting that is different then it reads it fine but it displays it in M/D/YY format. So my mask/validation has a real problem with this.
Can anyone tell me the best way to handle the different date formats from one PC to another? I dont really want to tell everyone that they have to change their date setting to conform to what my program is looking for. I am sure that I am not the first person to come across this.
Thanks for any input/help that you can give.