Moment Format Returns different values in backend / frontend code

278 Views Asked by At

Does moment(date).format('LL') return different values based on locale / timezone?

On my backend I'm getting: October 24, 2022 and on my frontend I'm getting 24 October 2022.

What can I do to ensure moment will return the same value regardless of timezone / locale?

I need it in a user friendly format, which is why I'm not using an ISO string.

1

There are 1 best solutions below

0
Alk On

Got this working by using .format('MMMM D, YYYY') instead