Date and Currency

M

Master

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

--
 
B

Bullschmidt

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!
 
E

Evertjan.

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")
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top