Date problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GriffithsJ

    Date problem

    Hi

    I have two Win2K machines. Both "appear" to have been set up identically.

    They both reckon that they're using UK date format.

    However, if I create the following ASP code:

    <%
    Response.Write Now
    %>

    One returns
    16/01/2004 17:12:19

    Which is what I want, whilst the other returns:

    1/16/2004 5:15:21 PM

    Here, the day and month have been transposed and the time appears in the 12
    hour clock format.

    Any suggestions as to how I can fix this?

    Many thanks

    Griff


  • sharad

    #2
    Re: Date problem

    Start->Control Panel->Regional & langauge settings.
    Click on 'Customise'
    Click on 'Date' tab and select the format you want for short as well as long
    date. click on "Time" tab and select
    the hours clock format you want.

    "GriffithsJ " <GriffithsJ_520 @hotmail.com> wrote in message
    news:OR5n3MF3DH A.1504@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Hi
    >
    > I have two Win2K machines. Both "appear" to have been set up identically.
    >
    > They both reckon that they're using UK date format.
    >
    > However, if I create the following ASP code:
    >
    > <%
    > Response.Write Now
    > %>
    >
    > One returns
    > 16/01/2004 17:12:19
    >
    > Which is what I want, whilst the other returns:
    >
    > 1/16/2004 5:15:21 PM
    >
    > Here, the day and month have been transposed and the time appears in the[/color]
    12[color=blue]
    > hour clock format.
    >
    > Any suggestions as to how I can fix this?
    >
    > Many thanks
    >
    > Griff
    >
    >[/color]


    Comment

    • Aaron Bertrand [MVP]

      #3
      Re: Date problem



      --
      Aaron Bertrand
      SQL Server MVP





      "GriffithsJ " <GriffithsJ_520 @hotmail.com> wrote in message
      news:OR5n3MF3DH A.1504@TK2MSFTN GP12.phx.gbl...[color=blue]
      > Hi
      >
      > I have two Win2K machines. Both "appear" to have been set up identically.
      >
      > They both reckon that they're using UK date format.
      >
      > However, if I create the following ASP code:
      >
      > <%
      > Response.Write Now
      > %>
      >
      > One returns
      > 16/01/2004 17:12:19
      >
      > Which is what I want, whilst the other returns:
      >
      > 1/16/2004 5:15:21 PM
      >
      > Here, the day and month have been transposed and the time appears in the[/color]
      12[color=blue]
      > hour clock format.
      >
      > Any suggestions as to how I can fix this?
      >
      > Many thanks
      >
      > Griff
      >
      >[/color]


      Comment

      • Aaron Bertrand [MVP]

        #4
        Re: Date problem

        That only affects the current logged on user. When he/she logs off, it goes
        back to the default, or get overridden by someone else logged on (even
        through terminal services, I believe).

        --
        Aaron Bertrand
        SQL Server MVP





        "sharad" <sharad@anonymo us.com> wrote in message
        news:eJAT$RF3DH A.1636@TK2MSFTN GP12.phx.gbl...[color=blue]
        > Start->Control Panel->Regional & langauge settings.
        > Click on 'Customise'
        > Click on 'Date' tab and select the format you want for short as well as[/color]
        long[color=blue]
        > date. click on "Time" tab and select
        > the hours clock format you want.
        >
        > "GriffithsJ " <GriffithsJ_520 @hotmail.com> wrote in message
        > news:OR5n3MF3DH A.1504@TK2MSFTN GP12.phx.gbl...[color=green]
        > > Hi
        > >
        > > I have two Win2K machines. Both "appear" to have been set up[/color][/color]
        identically.[color=blue][color=green]
        > >
        > > They both reckon that they're using UK date format.
        > >
        > > However, if I create the following ASP code:
        > >
        > > <%
        > > Response.Write Now
        > > %>
        > >
        > > One returns
        > > 16/01/2004 17:12:19
        > >
        > > Which is what I want, whilst the other returns:
        > >
        > > 1/16/2004 5:15:21 PM
        > >
        > > Here, the day and month have been transposed and the time appears in the[/color]
        > 12[color=green]
        > > hour clock format.
        > >
        > > Any suggestions as to how I can fix this?
        > >
        > > Many thanks
        > >
        > > Griff
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • GriffithsJ

          #5
          Re: Date problem

          This reports that it's set up the way that I require it. However, that's
          not the case...


          Comment

          • sharad

            #6
            Re: Date problem

            well, SQL commands, by default use US date and time format. Even if the
            machines are set as I said, Date() function in SQL will return the date and
            time in US format. The solution I found from varous white pages is (examle
            in VB) to use DateSerial function. [DateSearil(yyyy ,mm,dd)].
            Dunno about ASP code, may be it also has the same problem.

            Sharad

            "GriffithsJ " <GriffithsJ_520 @hotmail.com> wrote in message
            news:%23HKGUVF3 DHA.1720@TK2MSF TNGP10.phx.gbl. ..[color=blue]
            > This reports that it's set up the way that I require it. However, that's
            > not the case...
            >
            >[/color]


            Comment

            • GriffithsJ

              #7
              Re: Date problem

              Solved it!

              As mentioned, everything on the machine pointed towards the fact that the
              machine had been set up correctly - nothing in the registry pointed towards
              there being a mm/dd date format anywhere.

              We next attacked the IIS metabase, adding the key but to no affect.

              We then tried adding
              Session.LCID = 2057

              and this solved everything...(c ertainly cures the symptons if not the
              problem)

              Griff


              Comment

              • Balslev

                #8
                Re: Date problem

                Hi Griff,

                Where in metabase.xml did you enter this setting, and wasn't it
                SessionLCID="20 57"
                to be exact?

                I think my decimalpoint-problem has the same solution.

                Thanks,

                /René

                "GriffithsJ " <GriffithsJ_520 @hotmail.com> wrote in message
                news:#v0w4E03DH A.1704@tk2msftn gp13.phx.gbl...[color=blue]
                > Solved it!
                >
                > As mentioned, everything on the machine pointed towards the fact that the
                > machine had been set up correctly - nothing in the registry pointed[/color]
                towards[color=blue]
                > there being a mm/dd date format anywhere.
                >
                > We next attacked the IIS metabase, adding the key but to no affect.
                >
                > We then tried adding
                > Session.LCID = 2057
                >
                > and this solved everything...(c ertainly cures the symptons if not the
                > problem)
                >
                > Griff
                >
                >[/color]


                Comment

                • Balslev

                  #9
                  Re: Date problem

                  Sorry - of course you didn't insert Session.LCID into the metabase. It was
                  obviously ASP.

                  CU

                  /René
                  "GriffithsJ " <GriffithsJ_520 @hotmail.com> wrote in message
                  news:#v0w4E03DH A.1704@tk2msftn gp13.phx.gbl...[color=blue]
                  > Solved it!
                  >
                  > As mentioned, everything on the machine pointed towards the fact that the
                  > machine had been set up correctly - nothing in the registry pointed[/color]
                  towards[color=blue]
                  > there being a mm/dd date format anywhere.
                  >
                  > We next attacked the IIS metabase, adding the key but to no affect.
                  >
                  > We then tried adding
                  > Session.LCID = 2057
                  >
                  > and this solved everything...(c ertainly cures the symptons if not the
                  > problem)
                  >
                  > Griff
                  >
                  >[/color]


                  Comment

                  Working...