0

I'm running a local server with Node Js. I want to set the timezone for Europe, Rome but it doesn't seem to be working.

I installed: $ npm install time

Added this to my code:

var time = require('time');
var now = new time.Date();
now.setTimezone("Europe/Rome"); 

But when I use it it shows as (UTC +0):

var time = req.body.created_at = new Date().toISOString().replace(/T/, ';').replace(/\..+/, '')+ ';';
  • It doesn't work like that `Date()` and `time.Date()` are two completely separate objects – Neil Lunn Apr 14 '18 at 14:05
  • 1
    Possible duplicate of [How can I set the default timezone in node.js?](https://stackoverflow.com/questions/8083410/how-can-i-set-the-default-timezone-in-node-js) – Parrett Apps Apr 14 '18 at 14:29

0 Answers0