Python Forum
Confusion with datetime 'dst' function result
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Confusion with datetime 'dst' function result
#4
It's the same for my when test this.
Rather than try to figure what's going on,i would use Pendulum .
It provides drop-in replacements for datetime,pytz...ect (or inherit from them if needed).
Timezone is a really strong part that's done right.
>>> import pendulum
>>> 
>>> # Now not daylight savings time
>>> dt = pendulum.datetime(2019, 11, 15, tz='Europe/Berlin')
>>> dt.is_dst()
False

>>> # Go back to when it was daylight savings time(Norway)
>>> dt = pendulum.datetime(2019, 7, 15, tz='Europe/Berlin')
>>> dt.is_dst()
True 
Reply


Messages In This Thread
RE: Confusion with datetime 'dst' function result - by snippsat - Nov-15-2019, 08:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  unable to use result of solver in another function ross1993hall 0 1,430 Aug-10-2020, 10:29 AM
Last Post: ross1993hall
  Pass integers to datetime.date function florian 3 2,755 Jul-18-2020, 04:43 AM
Last Post: scidam
  How to use function result in another function Ayckinn 4 2,870 Jun-16-2020, 04:50 PM
Last Post: Ayckinn
  Pandas's regular expression function result is so strange cools0607 6 3,259 Jun-15-2020, 07:34 AM
Last Post: cools0607
  TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'str' findbikash 2 9,685 Sep-18-2019, 08:32 AM
Last Post: buran
  readshapefile function in basemap - confusion regarding arguments sendiptangshu 1 2,570 Mar-09-2019, 09:29 AM
Last Post: Larz60+
  Erratic Datetime result timsch 0 2,052 Dec-27-2018, 01:49 AM
Last Post: timsch
  SQLAlchemy DateTime result 0's AMarotta97 0 2,291 Oct-01-2018, 04:35 AM
Last Post: AMarotta97
  Why the IDE cannot show the result of zip function? Tony 2 2,945 May-19-2018, 02:58 AM
Last Post: Tony
  confusion on print function volcano 3 3,685 Mar-11-2018, 10:41 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020