1

I am working with the tumbler API and I am using the express framework for node.js, but I have a problem using the tumblr oAuth. The problem is the difference in timezones.

How I can change my current timezone?

4

1 回答 1

1

您可以在调用任何日期函数之前设置 TZ 环境变量。

> process.env.TZ = 'Europe/Amsterdam'
'Europe/Amsterdam'
> d = new Date()
Wed Mar 06 2013 23:30:42 GMT+0100 (CET)
> d.toString()
'Wed Mar 06 2013 23:30:42 GMT+0100 (CET)'
> d.toUTCString()
'Wed, 06 Mar 2013 22:30:42 GMT'
于 2013-03-06T22:33:45.873 回答