Q : Problem With Date Time Display Format

Discussion in 'ASP .Net' started by Marauderz, Jul 19, 2004.

  1. Marauderz

    Marauderz Guest

    Hello guys, got a little question regarding the regional language settings .

    Anyway I got a Windows 2003 Server machine that was installed with the date
    format "dd/MM/yyyy" and location still locked in US.

    As we migrated certain apps over to the new machine. we found out
    something... someone coded a Now.ToString in a database query... and the SQL
    Box is running MM/dd/yyyy! Chaos follows!!!

    I tried setting the Administrator account's date format back to MM/dd/yyyy
    under regional and language settings.
    I tried logging onto ASPNet user's account and setting the date format to
    MM/dd/yyyy but I still can't get Now.ToString to return in an "MM/dd/yyyy
    hh:mm tt"

    can anyone tell me where I should set the setting?

    Thanks!
     
    Marauderz, Jul 19, 2004
    #1
    1. Advertising

  2. Marauderz,

    When someone is browsing your application anonymously, there is no
    authenticated user. Therefore, there is no profile associated with the
    process user at that point. The locale settings in those situations are
    read from the .DEFAULT profile on the machine.

    You can change the settings for the .DEFAULT profile, but you have to do it
    via the Registry.

    1) Add the following registry keys with a value of 2
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OLEAUT
    VarConversionLocaleSetting = 2 (DWORD)
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\InetInfo\Parameters
    SetVarConversionLocaleSetting = 2 (DWORD)
    2) Make any changes that you would like your web application to use in
    your
    regional options(locale, short date, etc)
    3) Open Regedit and navigate to HKEY_CURRENT_USER\Control
    Panel\International
    4) Export this key to a file named currentuser.
    5) navigate to HKEY_USERS\.DEFAULT\Control Panel\International
    6) Export this key to a file named default
    7) Open default.reg and currentuser.reg in notepad.
    8) Copy the header from the default.reg and paste it over the header in
    currentuser.
    example:
    Default Currentuser
    before
    [HKEY_USERS\.DEFAULT\Control Panel\International]
    [HKEY_CURRENT_USER\Control Panel\International]
    after
    [HKEY_USERS\.DEFAULT\Control Panel\International]
    [HKEY_USERS\.DEFAULT\Control Panel\International]
    9) Save default.reg.
    10) Merge it into the registry.
    11) Restart IIS.

    This should ensure that the date formats are pulled from the .DEFAULT
    profile always. You can change these values in the future by following
    these steps.

    Jim Cheshire [MSFT]
    MCP+I, MCSE, MCSD, MCDBA
    Microsoft Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.


    --------------------
    >From: "Marauderz" <>
    >Subject: Q : Problem With Date Time Display Format
    >Date: Mon, 19 Jul 2004 09:36:10 +0800
    >Lines: 20
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
    >Message-ID: <#>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet
    >NNTP-Posting-Host: 210.187.6.69
    >Path:

    cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
    .phx.gbl
    >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:247991
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >
    >Hello guys, got a little question regarding the regional language settings
     
    Jim Cheshire [MSFT], Jul 19, 2004
    #2
    1. Advertising

  3. Marauderz

    Marauderz Guest

    Thanks for the suggestion... but it doesn't seem to work...
    Any other suggestions, I need a MM/dd/yyyy short date, maybe you could
    prepare a reg file for me that does the changes?
    Basically I need a US date display.

    The programmer that wrote SQL Injectable code is being flogged as I type. ;)

    Thanks.

    "Jim Cheshire [MSFT]" <> wrote in message
    news:...
    > Marauderz,
    >
    > When someone is browsing your application anonymously, there is no
    > authenticated user. Therefore, there is no profile associated with the
    > process user at that point. The locale settings in those situations are
    > read from the .DEFAULT profile on the machine.
    >
    > You can change the settings for the .DEFAULT profile, but you have to do

    it
    > via the Registry.
    >
    > 1) Add the following registry keys with a value of 2
    > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OLEAUT
    > VarConversionLocaleSetting = 2 (DWORD)
    > HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\InetInfo\Parameters
    > SetVarConversionLocaleSetting = 2 (DWORD)
    > 2) Make any changes that you would like your web application to use in
    > your
    > regional options(locale, short date, etc)
    > 3) Open Regedit and navigate to HKEY_CURRENT_USER\Control
    > Panel\International
    > 4) Export this key to a file named currentuser.
    > 5) navigate to HKEY_USERS\.DEFAULT\Control Panel\International
    > 6) Export this key to a file named default
    > 7) Open default.reg and currentuser.reg in notepad.
    > 8) Copy the header from the default.reg and paste it over the header in
    > currentuser.
    > example:
    > Default Currentuser
    > before
    > [HKEY_USERS\.DEFAULT\Control Panel\International]
    > [HKEY_CURRENT_USER\Control Panel\International]
    > after
    > [HKEY_USERS\.DEFAULT\Control Panel\International]
    > [HKEY_USERS\.DEFAULT\Control Panel\International]
    > 9) Save default.reg.
    > 10) Merge it into the registry.
    > 11) Restart IIS.
    >
    > This should ensure that the date formats are pulled from the .DEFAULT
    > profile always. You can change these values in the future by following
    > these steps.
    >
    > Jim Cheshire [MSFT]
    > MCP+I, MCSE, MCSD, MCDBA
    > Microsoft Developer Support
    >
    >
    > This post is provided "AS-IS" with no warranties and confers no rights.
    >
    >
    > --------------------
    > >From: "Marauderz" <>
    > >Subject: Q : Problem With Date Time Display Format
    > >Date: Mon, 19 Jul 2004 09:36:10 +0800
    > >Lines: 20
    > >X-Priority: 3
    > >X-MSMail-Priority: Normal
    > >X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
    > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
    > >Message-ID: <#>
    > >Newsgroups: microsoft.public.dotnet.framework.aspnet
    > >NNTP-Posting-Host: 210.187.6.69
    > >Path:

    >

    cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
    > phx.gbl
    > >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet:247991
    > >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > >
    > >Hello guys, got a little question regarding the regional language

    settings
     
    Marauderz, Jul 19, 2004
    #3
  4. Marauderz,

    I don't have a .reg file to send you. You will need to make those
    modifications yourself.

    You do want to make sure that the Registry keys you create for OLEAUT are
    DWORD values.

    Jim Cheshire [MSFT]
    MCP+I, MCSE, MCSD, MCDBA
    Microsoft Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.

    --------------------
    >From: "Marauderz" <>
    >References: <#>

    <>
    >Subject: Re: Q : Problem With Date Time Display Format
    >Date: Tue, 20 Jul 2004 02:19:44 +0800
    >Lines: 87
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
    >Message-ID: <>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet
    >NNTP-Posting-Host: 219.95.131.217
    >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:248183
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >
    >Thanks for the suggestion... but it doesn't seem to work...
    >Any other suggestions, I need a MM/dd/yyyy short date, maybe you could
    >prepare a reg file for me that does the changes?
    >Basically I need a US date display.
    >
    >The programmer that wrote SQL Injectable code is being flogged as I type.

    ;)
    >
    >Thanks.
    >
    >"Jim Cheshire [MSFT]" <> wrote in message
    >news:...
    >> Marauderz,
    >>
    >> When someone is browsing your application anonymously, there is no
    >> authenticated user. Therefore, there is no profile associated with the
    >> process user at that point. The locale settings in those situations are
    >> read from the .DEFAULT profile on the machine.
    >>
    >> You can change the settings for the .DEFAULT profile, but you have to do

    >it
    >> via the Registry.
    >>
    >> 1) Add the following registry keys with a value of 2
    >> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OLEAUT
    >> VarConversionLocaleSetting = 2 (DWORD)
    >> HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\InetInfo\Parameters
    >> SetVarConversionLocaleSetting = 2 (DWORD)
    >> 2) Make any changes that you would like your web application to use in
    >> your
    >> regional options(locale, short date, etc)
    >> 3) Open Regedit and navigate to HKEY_CURRENT_USER\Control
    >> Panel\International
    >> 4) Export this key to a file named currentuser.
    >> 5) navigate to HKEY_USERS\.DEFAULT\Control Panel\International
    >> 6) Export this key to a file named default
    >> 7) Open default.reg and currentuser.reg in notepad.
    >> 8) Copy the header from the default.reg and paste it over the header in
    >> currentuser.
    >> example:
    >> Default Currentuser
    >> before
    >> [HKEY_USERS\.DEFAULT\Control Panel\International]
    >> [HKEY_CURRENT_USER\Control Panel\International]
    >> after
    >> [HKEY_USERS\.DEFAULT\Control Panel\International]
    >> [HKEY_USERS\.DEFAULT\Control Panel\International]
    >> 9) Save default.reg.
    >> 10) Merge it into the registry.
    >> 11) Restart IIS.
    >>
    >> This should ensure that the date formats are pulled from the .DEFAULT
    >> profile always. You can change these values in the future by following
    >> these steps.
    >>
    >> Jim Cheshire [MSFT]
    >> MCP+I, MCSE, MCSD, MCDBA
    >> Microsoft Developer Support
    >>
    >>
    >> This post is provided "AS-IS" with no warranties and confers no rights.
    >>
    >>
    >> --------------------
    >> >From: "Marauderz" <>
    >> >Subject: Q : Problem With Date Time Display Format
    >> >Date: Mon, 19 Jul 2004 09:36:10 +0800
    >> >Lines: 20
    >> >X-Priority: 3
    >> >X-MSMail-Priority: Normal
    >> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
    >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
    >> >Message-ID: <#>
    >> >Newsgroups: microsoft.public.dotnet.framework.aspnet
    >> >NNTP-Posting-Host: 210.187.6.69
    >> >Path:

    >>

    >cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp1

    3
    >> phx.gbl
    >> >Xref: cpmsftngxa06.phx.gbl

    >microsoft.public.dotnet.framework.aspnet:247991
    >> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >> >
    >> >Hello guys, got a little question regarding the regional language

    >settings
    >
    >
    >
    >
     
    Jim Cheshire [MSFT], Jul 19, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shaiboy_UK
    Replies:
    0
    Views:
    495
    Shaiboy_UK
    Oct 19, 2003
  2. Brian Candy
    Replies:
    2
    Views:
    1,182
    Janaka
    Feb 18, 2004
  3. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,307
    Michael Borgwardt
    May 30, 2004
  4. Summu82
    Replies:
    5
    Views:
    883
    Richard Heathfield
    Jun 7, 2006
  5. dch3
    Replies:
    2
    Views:
    520
Loading...

Share This Page