Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have the following code:
timespan.Value("startTime").ToString("d. MMMM yyyy kl. HH.mm");
Where timespan.Value("startTime") comes from an Umbraco.DateTime property.
This gives me the error: "No overload for method 'ToString' takes 1 arguments".
How can I format the date without errors?
Did you try casting, converting or specifying the DateTime?
timespan.Value<DateTime>(...).ToString(...) ((DateTime)timespan.Value(...)).ToString(...) Convert.ToDateTime(timespan.Value(...)).ToString(...)
Cool - that works for me:
var startTime = timespan.Value<DateTime>("startTime"); var startTimeString = startTime.ToString("d. MMMM kl. HH.mm");
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Trying to format date from Umbraco.DateTime property gives "No overload for method 'ToString' takes 1 arguments"
I have the following code:
Where timespan.Value("startTime") comes from an Umbraco.DateTime property.
This gives me the error: "No overload for method 'ToString' takes 1 arguments".
How can I format the date without errors?
Did you try casting, converting or specifying the DateTime?
Cool - that works for me:
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.