How do i Edit the Date() function?

Hello.

When i use “timestamp: new Date()” i get this "Sun Apr 03 2016 16:31:10 GMT+0200 (W. Europe Daylight Time)"
I dont want to show that much data when i print timestamp.

  1. How do i modify what data i want to print, i want to remove (W. Europe Daylight Time)?
  2. Do the function Date() collect the time from my PC so it knows what timezone im in?

BR
Dimi

Hi @emilkl: Have a look at moment.js: http://momentjs.com/ That’s exactly what you need. There’s also an official Meteor integration: The trusted source for JavaScript packages, Meteor resources and tools | Atmosphere.

Yes, the browser knows your timezone from your operating system. Both JavaScript and moment will acknowledge that. moment.js is also timezone aware and allows you to do conversions.

That was what i was looking for :)Thank you

Dimi

1 Like