Customer Portal

function for returning day of week in CTL

Comments 1

  • Avatar
    Vladimir Barton
    0
    Comment actions Permalink
    Hello Pinwizard,
    extracting the day of the week can be achieved by using the appropriate date format, typically:

    • “EEE” – this will return a 3 letter weekday name (‘Mon’, ‘Tue’, etc.)

    • “EEEE” – this will return the full weekday name (‘Monday’, ‘Tuesday’, etc.)

    So basically, the only CTL function that you need is the date2str() function with the desired format definition that would convert a date in the date format into a string, for instance:

    $out.0.dayOfWeek = date2str(2018-07-13, "EEEE");

    Such transformation will output “Friday” as a string value.

    Kind regards,

Please sign in to leave a comment.