-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define timezone for timestamps #19
Comments
@baaswietse Now you can, I just added it: log.configure ({
time: {
yes: true,
format: 'locale',
locale: 'en-US',
options: { timeZone: 'America/Denver' }
}
}) It is the same options as described in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat Time zones can be looked up here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones P.S. You can also provide a custom printer, if the built-in formatter doesn't do the exact thing you need: log.configure ({ time: { yes: true, print: date => { /* format the date as needed */ }}) |
Thank you so much for the quick response! Just one side note, when defining the locale: 'be-NL' (I'm from Belgium). |
@baaswietse Try |
Oh wow, thank you sir! |
Is there any way to define your current timezone or an offset?
Right now the timestamps from the logger are 2 hours behind.
I couldn't find this in the docs.
Thanks.
The text was updated successfully, but these errors were encountered: