Anybody out there know how I can set the system date format in code? Some API or something??
Printable View
Anybody out there know how I can set the system date format in code? Some API or something??
Here it goes man:
http://www.vbworld.net/internet/atomictime/index5.html
Cheers, but not quite what I want.
I want to change the format of the system date, not the actual date value.
There is a registry key for date formats...
HKEY_CURRENT_USER\Control Panel\International\sLongDate
HKEY_CURRENT_USER\Control Panel\International\sShortDate
You can also modify the entries in the win.ini file. You might need a reboot for these changes to take effect though.
Cheers, I could use these and force the user to re-boot, but I think that would be a bit too much for the users. ;)
Anybody else have a way, where I don't have to re-boot?
It might work without a reboot, that was only a guess...
Can I ask why you need to change the date format anyway ?
All the machines in the company are set to English, but sometimes when something goes wrong with the machine it sets itself back to American, which screws up the existing software.
Now setting the format is a hastle as the users do not have the required permissions to do this themselves, so they have to phone somebody to do it (which usually takes a day).
Usually the affected software will just show an error message indicating that the user needs to have the format changed, but instead of going through all the delay, it would be nice if I could just change it when it is detected instead.
You can use the API 'SetLocaleInfo' to set the date and time formats.
Cheers, I'll give that a go.
Just done a quick search and found this example of it....
http://vb.ora.com/ron/short_date.html
better do some work myself...
Superb, thanks for all the help. :D