Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dutch Day & Month with DateFormat 1

Status
Not open for further replies.

TheSaint99

Technical User
Apr 20, 2001
13
GB
Is there a way to display the date in for example dutch days and months?
When I display my date with DateFormat(Now(), "d, mmmm yy") I get the day and month in English. Can someone explain to me how I can get it in another language??

Thnx in advance

TheSaint
 
yo TheSaint99

Id love to tell you that there is a magical language() function that works like this: language(x, "english") but there just isn't.

I know that Cold Fusion supports collections, which are groups of pages assigned a name. You might have 10 CFM files, and 3 collections named English, Dutch, German. When creating the collection you can specify a language to convert the collection of templates into, but only if you own the "ColdFusion International Search Pack". Anyway, this only works for complete groups of templates.. you're looking for a specific string to be replaced.

To do this the only thing I can suggest is a manual solution. It'll be a pain in the a$$, but I think you know what im talking about:

<CFSCRIPT>
dutchDays = arrayNew(1);
dutchMonths = arrayNew(1);

dutchDays[1] = &quot;1 in dutch&quot;;
dutchDays[2] = &quot;2 in dutch&quot;;
dutchDays[3] = &quot;3 in dutch&quot;;
//... etc
dutchDays[8] = &quot;8 in dutch&quot;;


dutchMonths[1] = &quot;january in dutch&quot;;
dutchMonths[2] = &quot;february in dutch&quot;;
//... etc
dutchMonths[5] = &quot;may in dutch&quot;;

//then

temp.day = dateformat(now(),&quot;d&quot;);
temp.mo = dateformat(now(),&quot;m&quot;);
temp.yr = dateformat(now(),&quot;yy&quot;);

temp.day = dutchDays[temp.day];
temp.mo = dutchMonths[temp.mo];

todaysDate = &quot;#temp.day#, #temp.mo# #temp.yr#&quot;;
</CFSCRIPT>

<CFOUTPUT>
#todaysdate#
</CFOUTPUT>
 
thanx for your help, I'll give it a try. I think it will work :)


TheSaint
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top