Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Johan 95 posts 264 karma points
    Dec 11, 2015 @ 15:38
    Johan
    0

    Changing the Create date formatting

    The CreateDate(currentdate) has the formatting MM/DD/YYYY H:MM:SS AM/PM. I'd like to change it to MM/DD/YYYY.

    How do I do it?

  • Anders Bjerner 487 posts 2990 karma points MVP 8x admin c-trib
    Dec 11, 2015 @ 16:42
    Anders Bjerner
    0

    Hi Johan,

    Is this within the backoffice of Umbraco or in the frontend implementation?

    I don't think it is possible date format of the backoffice - at least not out of the box. You may however be able to edit some of the Angular views used throughout the backoffice.

    If you want to change the date format in the frontend, can you then post a few examples of your code? Then I can have a look at it ;)

  • Amir Khan 1287 posts 2744 karma points
    Dec 11, 2015 @ 19:34
    Amir Khan
    1

    Johan, razor for the front end if that's what you're after.

    @CurrentPage.createDate.ToString("MM/dd/yyyy")
    

    Handy reference here: https://our.umbraco.org/wiki/reference/umbracolibrary/formatdatetime/

    -Amir

Please Sign in or register to post replies

Write your reply to:

Draft