If you do not want to use local time elsewhere in your process, one way to achieve what you want is to change the time zone for the process. Or by writing this expression when starting your application:
process.env.TZ = 'UTC'
Or, by running it using the environment variable from the command line, follow these steps:
TZ=UTC node main.js
source
share