inneedofhelp has asked for the wisdom of the Perl Monks concerning the following question:

Hi Very nice site. From perusing it for a week or so, i have already written a few perl proggies that i will post for your QA. Very pratical info. However, the date settings on my windows pc have now changed from u.k dd/mm/yy to us mm/dd/yy. Despite trying to change this back via ctrl panel etc , windows still uses the u.s format. i think it maybe to do with use Win32::OLE::NLS qw(:LOCALE :DATE); although im not sure. Please help TYIA Ash(srry for format)

Replies are listed 'Best First'.
Re: win32 date format
by Mr. Muskrat (Canon) on Feb 07, 2003 at 22:09 UTC

    What exactly are you trying to accomplish?
    Changing the Windows date format?
    Or changing the date format in one of your perl scripts?
    Or something else entirely?

    Also it's helpful if you post the code that you are trying to use.

      Hi Muskrat. The system date format has changed, so now all my windows programs report the date in U.S format, rather than U.K. The actual date is correct, just not in the correct format. Same in all programs. I think maybe i have set up some perl environmental variable that gets activated after windows loads that overrides whatever regional windows settings i have.

        Nothing to do with Perl. You need to set your locale

        Start|Settings|Control Panel|Regional Options|Gerneral or Date

        Just set the locale to English(United Kingdom) and then click on the Set as Default button and do the same. You need to do both because Microsoft don't believe in 1st normal databases. It is the same when you install windows - you have to set the locale 3 separate times to UK format - gotta love old M$. Alternatively click on the Date tab rather than General tab and set the desired format to whatever you want - yes you will need to set the long and short date formats or you will get some weird stuff happening.

        cheers

        tachyon

        s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print