Date and Currency

Discussion in 'ASP General' started by Master, Jul 2, 2004.

  1. Master

    Master Guest

    i have a little problem that i can't fix, in the Regional option of
    the Win2k server control panel i have set the Euro currency and
    the date format with dd/mm/yyyy but all the peoples that use a simple asp
    script like asp ASP date(),
    get the $ currency and the Usa date as mm/dd/yyyy, do you know where can
    i change this on the server?

    thank you

    --
     
    Master, Jul 2, 2004
    #1
    1. Advertising

  2. Master

    CJM Guest

    IIS will probably be using US date format by default.

    It's probably best that you forget trying to tweak your server, and instead,
    get your application to handle dates in a portable and consistent way:
    http://www.aspfaq.com/show.asp?id=2260

    Chris

    "Master" <dlc2000@@libero.it> wrote in message
    news:2M7Fc.404396$...
    > i have a little problem that i can't fix, in the Regional option of
    > the Win2k server control panel i have set the Euro currency and
    > the date format with dd/mm/yyyy but all the peoples that use a simple asp
    > script like asp ASP date(),
    > get the $ currency and the Usa date as mm/dd/yyyy, do you know where can
    > i change this on the server?
    >
    > thank you
    >
    > --
    >
    >
     
    CJM, Jul 2, 2004
    #2
    1. Advertising

  3. Master

    Bullschmidt Guest

    Dates & Times - Usage & Formatting by Darryl Fosbery - 7/15/2000
    http://www.asp-help.com/articles/dates.asp

    And to make a variable be in the format of mm/dd/yyyy (and the final
    line of code can be modifed for other date formats), perhaps try
    something like the following which you might even make into a function:

    varFld = CDate(MyVariable)

    intMonth = Month(varFld)
    intDay = Day(varFld)
    intYr = Year(varFld)

    If intMonth < 10 Then
    strMonth = "0" & CStr(intMonth)
    Else
    strMonth = CStr(intMonth)
    End If

    If intDay < 10 Then
    strDay = "0" & CStr(intDay)
    Else
    strDay = CStr(intDay)
    End If

    strYr = Right(CStr(intYr), 4) ' And change the 4 to 2 for 2 year dates.

    varFld = CStr(strMonth & "/" & strDay & "/" & strYr)

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Designer
    http://www.Bullschmidt.com
    ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Bullschmidt, Jul 5, 2004
    #3
  4. Master

    Evertjan. Guest

    Bullschmidt wrote on 05 jul 2004 in
    microsoft.public.inetserver.asp.general:
    > varFld = CDate(MyVariable)
    >
    > intMonth = Month(varFld)
    > intDay = Day(varFld)
    > intYr = Year(varFld)
    >
    > If intMonth < 10 Then
    > strMonth = "0" & CStr(intMonth)
    > Else
    > strMonth = CStr(intMonth)
    > End If


    strMonth = Right("0"+intMonth,2)

    > If intDay < 10 Then
    > strDay = "0" & CStr(intDay)
    > Else
    > strDay = CStr(intDay)
    > End If


    strDay = Right("0"+intDay,2)

    > strYr = Right(CStr(intYr), 4) ' And change the 4 to 2 for 2 year dates.
    >
    > varFld = CStr(strMonth & "/" & strDay & "/" & strYr)


    Why all these CStr()-s, Paul?

    ASP/vbs does this by default.

    ===============

    There are many ways to Rome, or to the White House:

    function Eur2Usa(d)
    dArr = split(d,"/")
    temp = dArr(0)
    dArr(0) = dArr(1)
    dArr(1) = temp
    Eur2Usa = join(dArr,"/")
    end function

    response.write Eur2Usa("dd/mm/yyyy")

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jul 6, 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. Matt
    Replies:
    1
    Views:
    649
    Matthew Speed
    Nov 8, 2003
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,373
    Michael Borgwardt
    May 30, 2004
  3. Matt
    Replies:
    2
    Views:
    570
    Pete Becker
    Nov 8, 2003
  4. Matt
    Replies:
    3
    Views:
    756
    Richard Heathfield
    Nov 8, 2003
  5. Dave
    Replies:
    1
    Views:
    2,240
Loading...

Share This Page