Python Forum
Calendar calcualtions
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calendar calcualtions
#12
Calendars are not easy.  Though I think leap years is the main complication.  Time is even worse, with timezones making things very wacky.

Unless you have a good reason to do otherwise, you should probably just use a library.
>>> import datetime as dt
>>> left = dt.date(1999, 11, 24)
>>> right = dt.date(2001, 3, 2)
>>> abs(left - right).days
464
Reply


Messages In This Thread
Calendar calcualtions - by deusvult - Apr-28-2017, 09:54 PM
RE: Calendar calcualtions - by wavic - Apr-28-2017, 10:06 PM
RE: Calendar calcualtions - by deusvult - Apr-28-2017, 10:09 PM
RE: Calendar calcualtions - by wavic - Apr-28-2017, 10:11 PM
RE: Calendar calcualtions - by deusvult - Apr-28-2017, 10:39 PM
RE: Calendar calcualtions - by wavic - Apr-28-2017, 11:04 PM
RE: Calendar calcualtions - by Ofnuts - Apr-30-2017, 08:55 PM
RE: Calendar calcualtions - by volcano63 - Apr-28-2017, 10:38 PM
RE: Calendar calcualtions - by zivoni - Apr-28-2017, 10:39 PM
RE: Calendar calcualtions - by Larz60+ - May-01-2017, 12:00 AM
RE: Calendar calcualtions - by volcano63 - May-01-2017, 01:31 AM
RE: Calendar calcualtions - by nilamo - May-01-2017, 02:56 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Task calendar problem humanical 8 1,935 Sep-04-2023, 02:55 PM
Last Post: Pedroski55
  Calendar program louienyy 2 5,078 Mar-30-2020, 01:21 PM
Last Post: louienyy
Sad [Learning] Calendar without modules or list KoFu 5 4,971 Sep-09-2019, 03:25 PM
Last Post: DeaD_EyE
  Calendar calculations frequency 10 5,778 Nov-13-2018, 07:34 PM
Last Post: frequency

Forum Jump:

User Panel Messages

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