question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Datetime timezone support

See original GitHub issue

Currently I am unable to set timezone for cases like this:

processed_at = mimesis('datetime')

But I would like to do something like:

# To select random tz:
processed_at = mimesis('datetime', timezone=True)  # True should be a default, here I am just explicitly calling it

processed_at = mimesis('datetime', timezone=some_specific_tz)

I am not sure about the dependecies. Timezone support out-of-the-box is limited, we almost always use something like pytz.

So, maybe in this case we will just implement the second case. Leaving timezone support optional. And only enabling passed in timezone.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Aug 2, 2018

@lk-geimfari got it. Thanks

0reactions
lk-geimfaricommented, Oct 16, 2018

Implemented in #539

Read more comments on GitHub >

github_iconTop Results From Across the Web

datetime — Basic date and time types — Python 3.11.1 ...
The timezone class can represent simple timezones with fixed offsets from UTC, such as UTC itself or North American EST and EDT timezones....
Read more >
DateTime::TimeZone - Time zone object base class and factory
This provides support for HPUX style time zones like 'MET-1METDST' . USAGE. This class has the following methods: DateTime::TimeZone->new( name => $tz_name )....
Read more >
Working with Datetime Objects and Timezones in Python
This guide will provide an overview of Python's datetime module with an emphasis on timezone related functions.
Read more >
10.9. Datetime Timezone - Python
Datetime Timezone¶. Important. Always keep dates and times only in UTC (important!) Datetimes should be converted to local time only when displaying to...
Read more >
4 Datetime Data Types and Time Zone Support
Businesses conduct transactions across different time zones. Oracle Database datetime and interval data types and time zone support make it possible to store ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found