Change in Short Date format under Hebrew Regional Settings

Discussion in 'ASP General' started by Laurence Neville, Dec 14, 2004.

  1. This is regarding a change in the Short Date format under Hebrew Regional
    Settings, that has caused huge problems in our ASP web application. The
    change appears to have been introduced sometime before Windows 2000 Service
    Pack 4 and has remained through to Windows XP. I am looking for a solution
    that doesn't involve rewriting our application (much) and that allows all
    our users to keep using Hebrew Regional Settings.

    To summarize our problem - we have an ASP-based intranet web application
    that is used in our Israel office. Before we installed Windows 2000 SP4 on
    our web server and on the client machines in the office, the application ran
    perfectly. Dates appeared on the pages and in input textboxes in the correct
    dd/mm/yyyy format. Immediately after installing SP4, dates on the pages and
    in input textboxes are formatted as yyyy/mm/dd. This is not just a visual
    change, it has caused many functions in the application to break.

    No change was made in the Control Panel Regional Options on the clients or
    server. In fact if you look there, when Hebrew is chosen, the short date
    format on the Date tab is set to dd/mm/yyyy.

    We have pinned the problem down to residing in the vbShortDate argument with
    the VBScript function FormatDateTime. Following the installation of SP4, RTL
    control characters are inserted (unicode character 8207) after each date
    separator (/) in the date returned.

    I am certain that this is a bug with windows, or a badly implemented new
    'feature'. Suppose we're working with the date January 20, 2004 and the
    serverside ASP code is returning exactly this (unformatted):
    20/01/2004 1:00:00
    When we format the date using FormatDateTime(datevalue, vbGeneralDate) we
    get this (the exact same thing):
    20/01/2004 1:00:00
    However, when we format the date using FormatDateTime(datevalue,
    vbShortDate) we get this:
    [Char8207]20/[Char8207]01/[Char8207]2004

    This translates to display (inside an input field in internet explorer) to:
    2004/01/20, although the date is really being written as the line above,
    i.e. [Char8207]20/[Char8207]01/[Char8207]2004. Internet Explorer is writing
    the date to the screen correctly, but the control characters that the
    formatdatetime function using vbshortdate argument are inserting are
    rearranging the display.

    The reason this is such a big problem is that other ASP functions that
    process dates do not recognise these dates that include the control
    characters as valid. If we use the IsDate function on the output of
    FormatDateTime("20/1/2004", vbShortDate) the result is FALSE (because the
    control characters exist).

    Does anyone know of a permanent solution to this problem that doesn't
    involve rewriting our application (much) and that allows all our users to
    keep using Hebrew Regional Settings?
    Laurence Neville, Dec 14, 2004
    #1
    1. Advertising

  2. Have you tried this:

    Thread.CurrentThread.CurrentCulture = new CultureInfo(1037);
    (1037 is "he-IL")
    I put this in my ASP.NET application in each page I show dates.


    "Laurence Neville" <> wrote in message
    news:%...
    > This is regarding a change in the Short Date format under Hebrew Regional
    > Settings, that has caused huge problems in our ASP web application. The
    > change appears to have been introduced sometime before Windows 2000

    Service
    > Pack 4 and has remained through to Windows XP. I am looking for a solution
    > that doesn't involve rewriting our application (much) and that allows all
    > our users to keep using Hebrew Regional Settings.
    >
    > To summarize our problem - we have an ASP-based intranet web application
    > that is used in our Israel office. Before we installed Windows 2000 SP4 on
    > our web server and on the client machines in the office, the application

    ran
    > perfectly. Dates appeared on the pages and in input textboxes in the

    correct
    > dd/mm/yyyy format. Immediately after installing SP4, dates on the pages

    and
    > in input textboxes are formatted as yyyy/mm/dd. This is not just a visual
    > change, it has caused many functions in the application to break.
    >
    > No change was made in the Control Panel Regional Options on the clients or
    > server. In fact if you look there, when Hebrew is chosen, the short date
    > format on the Date tab is set to dd/mm/yyyy.
    >
    > We have pinned the problem down to residing in the vbShortDate argument

    with
    > the VBScript function FormatDateTime. Following the installation of SP4,

    RTL
    > control characters are inserted (unicode character 8207) after each date
    > separator (/) in the date returned.
    >
    > I am certain that this is a bug with windows, or a badly implemented new
    > 'feature'. Suppose we're working with the date January 20, 2004 and the
    > serverside ASP code is returning exactly this (unformatted):
    > 20/01/2004 1:00:00
    > When we format the date using FormatDateTime(datevalue, vbGeneralDate) we
    > get this (the exact same thing):
    > 20/01/2004 1:00:00
    > However, when we format the date using FormatDateTime(datevalue,
    > vbShortDate) we get this:
    > [Char8207]20/[Char8207]01/[Char8207]2004
    >
    > This translates to display (inside an input field in internet explorer)

    to:
    > 2004/01/20, although the date is really being written as the line above,
    > i.e. [Char8207]20/[Char8207]01/[Char8207]2004. Internet Explorer is

    writing
    > the date to the screen correctly, but the control characters that the
    > formatdatetime function using vbshortdate argument are inserting are
    > rearranging the display.
    >
    > The reason this is such a big problem is that other ASP functions that
    > process dates do not recognise these dates that include the control
    > characters as valid. If we use the IsDate function on the output of
    > FormatDateTime("20/1/2004", vbShortDate) the result is FALSE (because the
    > control characters exist).
    >
    > Does anyone know of a permanent solution to this problem that doesn't
    > involve rewriting our application (much) and that allows all our users to
    > keep using Hebrew Regional Settings?
    >
    >
    Amiram Korach, Dec 15, 2004
    #2
    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. =?Utf-8?B?RGF2aWQgTGVlIEFV?=

    Setting date format, regional settings for ASP.NET

    =?Utf-8?B?RGF2aWQgTGVlIEFV?=, Jun 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    2,742
    =?Utf-8?B?RGF2aWQgTGVlIEFV?=
    Jun 15, 2004
  2. Phil Winstanley [Microsoft MVP ASP.NET]

    Re: Setting date format, regional settings for ASP.NET

    Phil Winstanley [Microsoft MVP ASP.NET], Jun 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    462
    Phil Winstanley [Microsoft MVP ASP.NET]
    Jun 15, 2004
  3. =?Utf-8?B?b3B0aWNzdG9ybQ==?=

    Getting client side regional settings date format

    =?Utf-8?B?b3B0aWNzdG9ybQ==?=, Jul 12, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    8,503
    Mark Rae
    Jul 12, 2005
  4. ABC
    Replies:
    1
    Views:
    403
    Patrick.O.Ige
    Apr 12, 2006
  5. David Lee AU
    Replies:
    1
    Views:
    201
    Aaron [SQL Server MVP]
    Jun 15, 2004
Loading...

Share This Page