I use a datatype date picker with time to show a date and the time of a match. It is shown like that : 2013-03-24T15:00:00
How can I format it?
foreach(var mannschaft in Model.Descendants()){
@mannschaft.GetProperty("title_" + Session["Lang"].ToString().ToLower())
@foreach(var spiel in mannschaft.Descendants()){
Format Date (date picker with time)
Hello!
I use a datatype date picker with time to show a date and the time of a match. It is shown like that : 2013-03-24T15:00:00
How can I format it?
foreach(var mannschaft in Model.Descendants()){
@mannschaft.GetProperty("title_" + Session["Lang"].ToString().ToLower())
@foreach(var spiel in mannschaft.Descendants()){
@spiel.GetProperty("datum").ToString("dd/MM/yyyy - H:mm")
} }
I tried like that with 'ToString' but it doesn't work :(
I want to show the date like this: 24/03/2013 - 15:00
Hi
@spiel.GetProperty("datum").ToString("f")
should return as you ask
Regards
G
Thank you for the quick reply, I tried it and I got back an error:
Error loading Razor Script 'Meisterschaft_GetMannschaften.cshtml'
No overload for method 'ToString' takes '1' arguments
try: @spiel.GetValue<DateTime>("datum").ToString("dd/MM/yyyy - H:mm")
Try
Thank you Fuji, it works ! :)
is working on a reply...