Skip to content

Ability to set local timezone would be really handy #42

Description

@createthis

I've been using timekeeper for years. It works great most of the time, but every now and then I run into a bug that is only reproducible by changing the local timezone. Timekeeper doesn't appear to have an ability to do that. There are a couple of other packages out there that do. One named chronokinesis seems interesting, but doesn't appear to be very popular. It appears to have the same API as timekeeper, but also has a timezone capability: https://github.com/paed01/chronokinesis#timezonetimezone

I don't know if it works or not. The only way I know to manipulate the local timezone is via environment variables:

const old_tz = process.env.TZ;
process.env.TZ = 'UTC';
// do stuff
process.env.TZ = old_tz;

Manipulating environment variables in tests is less than ideal due to shared state issues.

Can we get similar functionality in timekeeper?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions