Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Date and Currency

Reply
Thread Tools

Date and Currency

 
 
Master
Guest
Posts: n/a
 
      07-02-2004
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

--


 
Reply With Quote
 
 
 
 
CJM
Guest
Posts: n/a
 
      07-02-2004
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$(E-Mail Removed)...
> 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
>
> --
>
>



 
Reply With Quote
 
 
 
 
Bullschmidt
Guest
Posts: n/a
 
      07-05-2004
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!
 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      07-06-2004
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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JasperReports - formatting currency and date fields Dave Java 1 02-19-2007 12:38 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP .Net 1 11-08-2003 09:14 PM
Given a date, how to find the beginning date and ending date of that week Matt C Programming 3 11-08-2003 09:07 PM
Given a date, how to find the beginning date and ending date of that week Matt C++ 2 11-08-2003 08:30 PM



Advertisments