Forum Discussion

philliperamos's avatar
philliperamos
Contributor
6 years ago
Solved

Date Format to yyyy-MM-dd

Hi community, So I have a date that comes from the source system as: 2020-02-23T00:00:00:000 I would like to convert that date to just 2020-02-23 Any thoughts? Thanks.
  • philliperamos's avatar
    6 years ago

    The field is always there, but sometimes null.
    What I did was this:
    ($DATEFIELD != null ? $DATEFIELD.toString().substr(0,10) : $DATEFIELD)

    So that will just change the dates that are not equal to null.