Question

Locked

Regional Date setting (Short Date)

By Slayer_ ·
Does anyone know of a way to change the regional settings of a computer, but not have the change show in the control panel/regional settings?
We have a client that is somehow having such a problem, the regional settings in the control panel are correct, but the system is reading it from "someplace else" and using the wrong short date format.

It was in their login scripts, a reg file to correct the problem short date, but even that does not work, the file runs, the registry is correct, the GUI control panel shows correct, but the date format is still somehow wrong. (MM/dd/yyyy vs dd/MM/yyyy)

These are XP Pro machines

Any thoughts?


Edit
Solved (mostly). The VBScript changing the regional settings appears to be the culprit

This conversation is currently closed to new comments.

18 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Answers

Collapse -

OK, the regional settings are correct, but,

by seanferd In reply to Regional Date setting (Sh ...

was the date format customized at the cpl? Was it perhaps customized in the local admin account and set to apply to the default profile as well, prior to setting up user accounts?

Only other things I can think of are: Group policy overriding the settings or another application which provides an interface to these settings.

Collapse -

Reponse To Answer

by Slayer_ In reply to OK, the regional settings ...

So far, some research shows that the current user registry key was correct, an API call to grab the current setting worked, however, the application refused to read it correctly (Using MS OCX's such as date pickers). After I went into the regional settings manually, change them, then changed them back, suddenly everything started working. Is there maybe something else that needs to be set?

Collapse -

Are you sure it's the whole computer?

by john.a.wills In reply to Regional Date setting (Sh ...

Or could it be just one application with the problem? Applications can overwrite the system settings - sometimes they are intended to.

Collapse -

Reponse To Answer

by Slayer_ In reply to Are you sure it's the who ...

Its a VBA application, most of the problems happens when converting strings to a date

example
?format(cdate("01/02/2010"),"MMMM d, yyyy")
Returns if set to Canadian
February 1, 2010
If set to American
January 2, 2010

Problem is in the registry, it is set to american, but when the code is run, it thinks it is Canadian.
As I said in the previous response, when I opened up the regional settings in the control panel, changed them, closed the panel, reopened it, changed them back, closed the panel, the code started working correctly.

Collapse -

Like john, I would still be looking for another app

by seanferd In reply to Regional Date setting (Sh ...

which might change this. If everything appears to be set correctly, are you sure that the OCXs are a) getting their information from datime, and b) whatever call is being made with the OCX is structured (or whatever) properly to get the date in the desired format.

Collapse -

If it isn't paying attention to the setting

by Tony Hopkinson In reply to Regional Date setting (Sh ...

then either it's being overridden in the code, or you've run into a bad bit of windows code or broken / unpatched windows install.
I've seen this a few times particularly with variants (directky or through ADO, some of the old code is hard coded to american as a default.
Given your response I suspect there's an override in application start up, your code or some MS drivel, given it squared it self up after you used control panel to toggle it, presumably while the app was running???

Collapse -

We have sort of figured it out, thanks for suggestions

by Slayer_ In reply to Regional Date setting (Sh ...

It looks like, the VBScript they were using to set the regional settings, were not working. I took an export of the International Key and imported it into a broken machine and it immediately started working. Running the exact same changes through VBScript breaks it again. Just importing the .reg file works fine. I told them to silently execute the reg file from their login script, hopefully that's what they will do. Worst case, they can just send the .reg file to each user with an email telling them to run it.


@Seanferd
LOL, can't its their missions critical program, without it, business closes.

Collapse -

Reponse To Answer

by seanferd In reply to We have sort of figured i ...

"LOL, can't its their missions critical program, without it, business closes. "

I'm not exactly sure what you are referring to. I didn't suggest getting rid of the app (although at this point it sounds like it isn't written properly).

Collapse -

format(cdate("01/02/2010"),"MMMM d, yyyy")

by Tony Hopkinson In reply to Regional Date setting (Sh ...

And there's your problem,
it should be
format(cdate("2010-01-02"),"MMMM d, yyyy")
or
format(cdate("2010-02-01"),"MMMM d, yyyy")

Always use a universal format for dates input as strings.

Collapse -

Reponse To Answer

by Slayer_ In reply to format(cdate("01/02/ ...

I am just showing an example of how regional settings effect it.

And the "Real" problem is caused by code that is not ours.

Back to Windows Forum
18 total posts (Page 1 of 2)   01 | 02   Next

Operating Systems Forums