⬅︎ Back to Be careful with Date.toLocaleDateString() in JavaScript
> new Date('2014-11-27T02:50:49Z').toLocaleDateString('en', { 'day': 'numeric', 'timeZoneName': 'short' })'27, UTC'I did not know about `timeZoneName`. Thanks for the tip!
What happens if you print the timezone? Do you get a different value on your laptop than on your server? new Date('2014-11-27T02:50:49Z').toLocaleDateString('en', { 'day': 'numeric', 'timeZoneName': 'short' })
Comment
> new Date('2014-11-27T02:50:49Z').toLocaleDateString('en', { 'day': 'numeric', 'timeZoneName': 'short' })
'27, UTC'
I did not know about `timeZoneName`. Thanks for the tip!
Parent comment
What happens if you print the timezone? Do you get a different value on your laptop than on your server? new Date('2014-11-27T02:50:49Z').toLocaleDateString('en', { 'day': 'numeric', 'timeZoneName': 'short' })