I'm currently trying to figure out how I can make a duration between 1 AM to 7 AM (01:00-07:00) using Pendulum - I have been trying to read the documentation and the closests thing I could find was using duration
however I was not able to see how I can check if the time is between 01:00 to 07:00.
I wonder if it is possible to use pendulum to check if the time is between the interval?
Expect:
Print out "The time is between 01:00 to 07:00" and if its not then print "The time is NOT between 01:00 to 07:00"
If I'm understanding you correctly, you're looking to determine if a given time is between 01:00 and 07:00. To be honest, you could getaway with just using
datetime
rather than installing a new package. Withdatetime
, I would just do:Since
pendulum
inherits fromdatetime
anyway, this should be compatible if you really want to usependulum
. You'll just need to change some syntax.