Original TZ is not restored if tzset() throws #22

wants to merge 2 commits into

1 participant


So after an error current timezone would be in invalid state:

> var date = new (require('time').Date)()

> date.setTimezone('WTF')
Error: Unknown Timezone: 'WTF'
    at Function.tzset (/home/alex/broadsend/node_modules/time/index.js:150:15)
    at Date.setTimezone (/home/alex/broadsend/node_modules/time/index.js:252:19)

> new Date()
Wed Sep 05 2012 21:38:06 GMT+0000 (WTF)

PS: if I try to use this module with an arbitrary user-supplied data, will I have any security problems here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment