Ahh okay. Actually the culture-attribute wasn't even there, so I gues it just took the system default language?
But now I have set the culture="en-US" and the dayname is now shown the right way, with three letters. Weird that the danish language only would show the dayname with two letters.
But thank you very much for the help Thomas :)
By the way. Does this have any effect on other parts of my site now that the culture is set to english instead of danish, when its a danish site? I think of either our special danish characters (æ, ø and å) or things like that.
Now my globalization culture is set to en-US, and my daynames are in the right format in my RSS-feed. But when I use the umbraco.library:formatDate to write out the date, it is off course written in english. This means that this month is spelled October. I would like it to be spelled in Danish like this: oktober.
Is this in some way possible? To use the english daynames in my RSS, but every other places on my site use the danish language?
If you are using .NET code you can set the culture for the current Output. But this isn't possible via umbraco.library:FormatDateTime. This function uses the actual culture set via web.config or via culture of the server.
You can write your own xslt extension:
Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE"); return DateTime.Now.ToString("ddd, dd MMM yyyy hh:mm:ss");
I can't write .NET code yet unfortunately. But i tried making a hostname on my Frontpage, with danish as the language. And it did the trick. So now my dates are english in my RSS-feeds, but on the website frontend they are translated to danish.
Problem with the FormatDateTime
Hi there
I'm making a RSS-feed for one of my sites in version 4.0.2.1, and would like the <pubDate> to look like this: '
So I'll use the FormatDateTime extension in Umbraco like this:
In my head that would give me the correct format of the date, but it doesn't.
Almost all of if works, except the dayname (ddd). I get this:
To the non-danish people: the "on" is short for "onsdag" wich means wednesday :)
If I use four d's instead of three d's I get this result:
Wich is the whole name of the day.
Is this a bug in the FormatDateTime, or am I doing it wrong?
No, that is because your application is running on a danish windows.
Try to change the culture in the web.config, eg. for german output I use
in the system.web section
hth, Thomas
Ahh okay. Actually the culture-attribute wasn't even there, so I gues it just took the system default language?
But now I have set the culture="en-US" and the dayname is now shown the right way, with three letters. Weird that the danish language only would show the dayname with two letters.
But thank you very much for the help Thomas :)
By the way. Does this have any effect on other parts of my site now that the culture is set to english instead of danish, when its a danish site? I think of either our special danish characters (æ, ø and å) or things like that.
I have a follow-up question to this post.
Now my globalization culture is set to en-US, and my daynames are in the right format in my RSS-feed. But when I use the umbraco.library:formatDate to write out the date, it is off course written in english. This means that this month is spelled October. I would like it to be spelled in Danish like this: oktober.
Is this in some way possible? To use the english daynames in my RSS, but every other places on my site use the danish language?
If you are using .NET code you can set the culture for the current Output. But this isn't possible via umbraco.library:FormatDateTime. This function uses the actual culture set via web.config or via culture of the server.
You can write your own xslt extension:
or
hth,
Thomas
I can't write .NET code yet unfortunately. But i tried making a hostname on my Frontpage, with danish as the language. And it did the trick. So now my dates are english in my RSS-feeds, but on the website frontend they are translated to danish.
But thanks for your help anyway Thomas :)
is working on a reply...