Link to home
Start Free TrialLog in
Avatar of dingir
dingirFlag for Sweden

asked on

Swedish dateformat

I'm itching my head off getting this format: "21 februari 2006"

The codepage would be sweden, LCID = ??
Also the text of the month (if it don't work with swedish monthnames, then just show the first three chars) and how do I make the today-date prints like that above?
Maybe Swedish monthname works with some kind of with-function? If month = 01 then "januari" aso.

Swedish month from january to december:
 januari
 februari
 mars
 april
 maj
 juni
 juli
 augusti
 september
 oktober
 november
 december

Thank you!
Avatar of Colosseo
Colosseo
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi you can find the LCID list here

http://www.webwizguide.com/asp/faq/date_time_settings.asp

so 1053 for sweden

Scott
Or you could set up an array with the months like this

arrSWEMon = Array("","januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december")

Then when you want the month just use

arrSWEMon(1)

to give you januari

or arrSWEMon(DATEPART("m",now()))

to give you the current month (februari)

Scott
Avatar of dingir

ASKER

Hi Scott! Thank you! But the main problem is the code to format the today date as mentioned above: "21 februari 2006"
ASKER CERTIFIED SOLUTION
Avatar of Colosseo
Colosseo
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dingir

ASKER

Colosseo! Thank you! That was EXACTLY what I need! I've spent hours on difference formatting and failed :-)

Result:

<%

Function getSWEDate()

     strTempDate = ""

     arrSWEMon = Array("","januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december")

     strTempDate = DATEPART("d",now()) & " " & arrSWEMon(DATEPART("m",now())) & " " & DATEPART("yyyy",now())

     getSWEDate =  strTempDate

End Function

%>

<%=getSWEDate()%>