Aller au contenu principal

[5.45] Format date in output CSV

Terminée

Commentaires

1 commentaire

  • Ken Lyon

    Hi John Nerge ,

    There is a new enhancement coming in Workflow 5.45 (next week, all being well!) that will allow you to supply a custom format string to the Format Date activity. Based on your example, the format string “M/d/yyyy” would produce the desired output.

    In the meantime, the alternative approach would be to use the getMonth(), getDate() and getFullYear() methods of Date. Since it looks like you don't want to pad the day or month with leading zeroes, you might just be able to do this:

    =`${$myDate.result.getMonth() + 1}/${myDate.result.getDate()}/${myDate.result.getFullYear()}`

    Be careful of the month in particular the value is 0-11, not 1-12 as you might expect.

    0

Vous devez vous connecter pour laisser un commentaire.