My old code use momentjs, something like this :
moment(createdAt, 'YYYY-MM-DD HH:mm:ss').toISOString()
What is the equivalent method on date-fns that will reproduce same result ?
My old code use momentjs, something like this :
moment(createdAt, 'YYYY-MM-DD HH:mm:ss').toISOString()
What is the equivalent method on date-fns that will reproduce same result ?
date-fns has a function: formatISO() So, if you want to stay with date-fns you can write:
formatISO(new Date())