regional settings inconsistency

Discussion in 'ASP General' started by Janette, Jul 17, 2006.

  1. Janette

    Janette Guest

    Hi,

    I have done a lot of reading before doing this posting, but I just can't
    find a solution that makes sense.

    eg http://support.microsoft.com/default.aspx/kb/306044 - Behavior of
    Date/Time format differs when accessed from Active Server Pages
    and http://support.microsoft.com/kb/264063/ - VBScript Date and Time
    Functions May not be Formatted Properly in Non-English (US) Locales

    I have a production ASP based website running on Windows2000 server. I am
    trying to migrate it to another Windows2000 server manually. All is working
    except the regional settings. I have checked the HKEY_USERS\.DEFAULT\Control
    Panel\International settings and they are the same between servers. But when
    I run the application the use of now() in the vbscript is giving the wrong
    date format. I am at a complete loss. Everything I have read points me to
    this registry setting being used by IIS for getting the regional settings,
    but it is not working.

    If it were a new application I would just be more explicit and use datepart
    to put together the values I require, but this application has been running
    successfully for over 4 years and I am afraid I will miss somewhere and it
    will not be found for a long while.

    Can anyone suggest where else I should check, eg somewhere in the IIS setup,
    in order to fix this problem.

    Is it possible there is some patch I might be missing after Win2000 Service
    Pack 4 that addresses this?

    Thanks in advance
    Janette
     
    Janette, Jul 17, 2006
    #1
    1. Advertising

  2. Janette

    Janette Guest

    Just another curious addition. I coded

    response.write(getlocale())

    into a page and got the result 1033, where it should be 3081 according to
    the registry setup.

    I then coded

    setlocale(3081)
    response.write( getlocale() & "<br>")
    response.write( now())

    and now() still gives the 1033 format. I was sure this should have fixed it.

    Very confused
    Janette


    "Janette" <> wrote in message
    news:...
    > Hi,
    >
    > I have done a lot of reading before doing this posting, but I just can't
    > find a solution that makes sense.
    >
    > eg http://support.microsoft.com/default.aspx/kb/306044 - Behavior of
    > Date/Time format differs when accessed from Active Server Pages
    > and http://support.microsoft.com/kb/264063/ - VBScript Date and Time
    > Functions May not be Formatted Properly in Non-English (US) Locales
    >
    > I have a production ASP based website running on Windows2000 server. I am
    > trying to migrate it to another Windows2000 server manually. All is
    > working except the regional settings. I have checked the
    > HKEY_USERS\.DEFAULT\Control Panel\International settings and they are the
    > same between servers. But when I run the application the use of now() in
    > the vbscript is giving the wrong date format. I am at a complete loss.
    > Everything I have read points me to this registry setting being used by
    > IIS for getting the regional settings, but it is not working.
    >
    > If it were a new application I would just be more explicit and use
    > datepart to put together the values I require, but this application has
    > been running successfully for over 4 years and I am afraid I will miss
    > somewhere and it will not be found for a long while.
    >
    > Can anyone suggest where else I should check, eg somewhere in the IIS
    > setup, in order to fix this problem.
    >
    > Is it possible there is some patch I might be missing after Win2000
    > Service Pack 4 that addresses this?
    >
    > Thanks in advance
    > Janette
    >
     
    Janette, Jul 17, 2006
    #2
    1. Advertising

  3. Hello Janette,

    In Control panel\regional and language Options, you may change the locale
    and Date Time format here. After the changes, you may perform a reboot and
    test your ASP page again, will it give correct result after this?

    Sincerely,

    Luke Zhang

    Microsoft Online Community Support
    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Luke Zhang [MSFT], Jul 17, 2006
    #3
  4. Janette

    Janette Guest

    Hi Luke,

    Firstly, the settings are correct in the control panel/regional and
    langauage Options, but yes I have tried this, tried rebooting and stopping
    and starting IIS and have had no change.

    Regards
    Janette



    "Luke Zhang [MSFT]" <> wrote in message
    news:...
    > Hello Janette,
    >
    > In Control panel\regional and language Options, you may change the locale
    > and Date Time format here. After the changes, you may perform a reboot and
    > test your ASP page again, will it give correct result after this?
    >
    > Sincerely,
    >
    > Luke Zhang
    >
    > Microsoft Online Community Support
    > ==================================================
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
    >
    >
     
    Janette, Jul 17, 2006
    #4
  5. Hello Janette,

    In you test code:

    setlocale(3081)
    response.write( getlocale() & "<br>")
    response.write( now())


    If you replace the "setlocale(3081)" with :

    Session.LCID = 3081

    With this give correct output for date time string?

    Sincerely,

    Luke Zhang

    Microsoft Online Community Support
    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Luke Zhang [MSFT], Jul 18, 2006
    #5
  6. Janette

    Janette Guest

    Hi Luke,

    I tried using Session.LCID = 3081 and it works. I still don't understand
    1. Why Session.LCID works and setlocale(3081) doesn't
    2. Why I need to set Session.LCID = 3081 at all when this code on my old
    server correctly picked up the server default for the locale.

    Anyway, thanks, I will just have to run with this solution for now, as I
    have no alternative.
    Regards
    Janette


    "Luke Zhang [MSFT]" <> wrote in message
    news:...
    > Hello Janette,
    >
    > In you test code:
    >
    > setlocale(3081)
    > response.write( getlocale() & "<br>")
    > response.write( now())
    >
    >
    > If you replace the "setlocale(3081)" with :
    >
    > Session.LCID = 3081
    >
    > With this give correct output for date time string?
    >
    > Sincerely,
    >
    > Luke Zhang
    >
    > Microsoft Online Community Support
    > ==================================================
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
    >
    >
     
    Janette, Jul 18, 2006
    #6
  7. Hello Janette,

    Based on my experience, Session.LCID is right working way in an ASP page;
    setlocale() is intend to work in VBScript application. For example, a .vbs
    file.

    Sincerely,

    Luke Zhang

    Microsoft Online Community Support
    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Luke Zhang [MSFT], Jul 19, 2006
    #7
    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. René de Leeuw

    Regional settings

    René de Leeuw, Jul 2, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    580
    René de Leeuw
    Jul 2, 2003
  2. Lachlan James

    problem with regional & language settings

    Lachlan James, Aug 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    568
    Lachlan James
    Aug 5, 2003
  3. Phil
    Replies:
    0
    Views:
    606
  4. Karunakararao
    Replies:
    0
    Views:
    650
    Karunakararao
    May 11, 2004
  5. donet programmer
    Replies:
    3
    Views:
    1,560
    Gregory A. Beamer
    Nov 20, 2009
Loading...

Share This Page