Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Date and Currency (http://www.velocityreviews.com/forums/t795244-date-and-currency.html)

Master 07-02-2004 07:02 AM

Date and Currency
 
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 07-02-2004 11:44 AM

Re: Date and Currency
 
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$hc5.17410067@news3.tin.it...
> 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
>
> --
>
>




Bullschmidt 07-05-2004 06:44 PM

Re: Date and Currency
 
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!

Evertjan. 07-06-2004 07:35 AM

Re: Date and Currency
 
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)


All times are GMT. The time now is 08:22 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.