I want to show the date where my evenst are created but it shows 01 januar to everything events, why is that. I am using globalization da-dk
here is the code i use for my datetime
@(Model.Content.GetPropertyValue<DateTime>("createDate").ToString("dd. MMMM", new CultureInfo("da-dk")))
I think CreateDate is a Umbraco-property, so you can do:
@item.CreateDate.ToString("dd. MM")
If you've got a single language site, you can also set the default language to danish. In the "Settings"-section under Language you probably got English. Click on it at select danish from the dropdown.
You could also add Danish as a language in the same place and on your root-node in "Content" right-click and selevt "Set domain". Here you also can select one of the installed languages.
i need help with my datetime
Hi every one.
I want to show the date where my evenst are created but it shows 01 januar to everything events, why is that. I am using globalization da-dk here is the code i use for my datetime
that indicates that the value is not ready - of you to a .ToString() (without format) you will see the value is most likely 1900-01-01 00:00:00
Do you have a typo in you property alias?
how can i fix it :D
You're using Model.Content but you seem to be looping through content.. are you sure you should not have something like
currentEventItem.GetPropertyValue
Hi Steve i dont now how to use it. It seems to that no matter what i try then i get the date 01 januar or northing ? :D
and if i use @Umbraco.Field("createDate", formatAsDate: true) i get what i want but in english and i want it to be danish :D
Show us your code.. including the loop!
Here is my code
Did you try
@item.GetPropertyValue<DateTime>("createDate").ToString("dd. MMMM", new CultureInfo("da-dk")))
Yes and it is the same result🙂
It is stil the same. I dont get it whats wrong with the code :) you can see the date 01 Januar on every events
And here is my code
I think CreateDate is a Umbraco-property, so you can do:
If you've got a single language site, you can also set the default language to danish. In the "Settings"-section under Language you probably got English. Click on it at select danish from the dropdown. You could also add Danish as a language in the same place and on your root-node in "Content" right-click and selevt "Set domain". Here you also can select one of the installed languages.
that is also what i got to :D her is what i didt thanks for the help eveyone :D
is working on a reply...