Question UK Style Date?

Ian W

Active member
Joined
Feb 11, 2010
Messages
31
Programming Experience
1-3
In my app i'm writing a date value to an access backend.

I'm currently using DateString but its formatting it as mm/dd/yy when I need it to be dd/mm/yy.

All my regional settings are set to UK but it doesn't seem to have any effect.

Do I need to to put a localisation global or declare the region in the app for it to pick up the correct format?
 
Do NOT convert your dates to strings. Store them in the database as dates, not text. Store them in your VB code as dates, not text. If your dates are in binary form at all times then format is NEVER an issue because binary dates have no format. It's only when converting to or from text that format is an issue. If you never convert to or from text then there's no issue.
 
Thanks for the reply.

What would I use other than DateString to enter the current date into my table then?
 
VB has a Date type and a String type. If you want to work with dates then the obvious choice is Date. If you use the Date type then format is never an issue.

The DateString property returns the current date as a String. To get the current date as a Date you should be using Date.Now if you want time as well or Date.Today if you want just date.
 
Back
Top