Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Timezone offset - Disable UTC mode from Momentjs #30
Currently the UTC mode from Momentjs is being used. This disables the timezone offset and is always set to 0.
Could you remove that UTC mode? You simply need to create Moment objects without calling to the
I want to print the timestamp in the ISO format by passing
I think having the time expressed as UTC is much more useful than being able to express the timezone. By using UTC, you don't even need a zone so I'm not sure really what the use case of this is. Working with UTC also makes testing easier because the time is the time, regardless of where your computer is sitting.
If you truely need this feature, good-console is small enough for you to fork and implement on your own. It is unlikely that this will change here however.
Sorry but I don't agree with you. Typically, the console output is used for debugging purposes in the development environment. I'm living in Spain and we currently have +1 offset, so when Hapi sends a log to the console, instead of displaying our current hour, say 16:00, it logs the UTC hour, 15:00. I develop in my local machine, so I would like to seethe local time of my machine.
By disabling the UTC mode you're not losing anything, but if you leave it enabled, you're just not letting the users to display the correct local time.
var moment = require('moment'); console.log(moment().utc().format()); // 2015-01-05T15:32:09+00:00 console.log(moment().format()); // 2015-01-05T16:32:09+01:00
If you simply remove the
Alternatively, you can add an