On 12/15/2022 11:34 PM, MRAB wrote:
On 2022-12-15 22:49, Gronicus@SGA.Ninja wrote:
Yes, it works like a charm. On the tupility of it all.
Special thanks for the explanation too…..
(Originally asked but I found the errors. All is working)
Now that the code no longer produces the errors, I see
On 2022-12-15 22:49, Gronicus@SGA.Ninja wrote:
Yes, it works like a charm. On the tupility of it all.
Special thanks for the explanation too…..
(Originally asked but I found the errors. All is working)
Now that the code no longer produces the errors, I see that the year and month
not incl
ot;77 Hours = <" + str(hours) + ">")
print ("78 Minutes = <" + str(minutes) + ">")
if hours > 7:
print(" Time to inject Humulin R u500.")
pause = input("Pause")
#
?
From: anthony.flury
Sent: Thursday, December 15, 2022 1:47 PM
To: Gronicus@SGA.Ninja
Subject: RE: Subtracting dates to get hours and minutes
What is likely happening is that when you read the data from the file you are
not reading a tuple, you are reading a 26 charcter string.
You have to
, December 15, 2022 at 5:02 PM
To: 'anthony.flury' , python-list@python.org
Subject: RE: Subtracting dates to get hours and minutes
*** Attention: This is an external email. Use caution responding, opening
attachments or clicking on links. ***
Yes, it works like a charm. On the tupility
PM
To: Gronicus@SGA.Ninja
Subject: RE: Subtracting dates to get hours and minutes
What is likely happening is that when you read the data from the file you are
not reading a tuple, you are reading a 26 charcter string.
You have to convert that string into a tuple - the easiest way will be
c.total_seconds() / 60
minutes = c.seconds / 60
hours = 0
while (minutes > 59):
minutes = minutes - 60
hours += 1
minutes = round(minutes)
print ("77 Hours = <" + str(hours) + ">")
print ("78 Minutes = <" + str(minutes) + ">")
if hours > 7:
print(" T
=
print()
c = NowTime - Stopp
minutes = c.total_seconds() / 60
minutes = c.seconds / 60
hours = 0
while (minutes > 59):
minutes = minutes - 60
hours += 1
minutes = round(minutes)
print ("77 Hours = <" + str(hours)
Hours = <" + str(hours) + ">")
print ("78 Minutes = <" + str(minutes) + ">")
if hours > 7:
print(" Time to inject Humulin R u500.")
pause = input("Pause")
# ==
-
, December 13, 2022 11:20 PM
To: python-list@python.org
Subject: Re: Subtracting dates to get hours and minutes
Your problem is that datetime.datetime does not accept a tuple as an
argument. It expects an integer value for the first argument, but you
supplied a tuple. In Python, you can use a sequ
assin
Sent: Tuesday, December 13, 2022 11:20 PM
To: python-list@python.org
Subject: Re: Subtracting dates to get hours and minutes
Your problem is that datetime.datetime does not accept a tuple as an
argument. It expects an integer value for the first argument, but you
supplied a tuple. In Python, you
Your problem is that datetime.datetime does not accept a tuple as an
argument. It expects an integer value for the first argument, but you
supplied a tuple. In Python, you can use a sequence (e.g., tuple or
list) the way you want by prefixing it with an asterisk. This causes
the sequence of
As is, Test A works.
Comment out Test A and uncomment Test B it fails.
In Test B, I move the data into a variable resulting with the report:
"TypeError: an integer is required (got type tuple)
How do I fix this?
#-
behalf of Marc Lucke
Date: Monday, December 12, 2022 at 11:37 AM
To: python-list@python.org
Subject: Re: Subtracting dates to get hours and minutes
*** Attention: This is an external email. Use caution responding, opening
attachments or clicking on links. ***
my approach would be to convert your
my approach would be to convert your two date/times to seconds from
epoch - e.g.
https://www.geeksforgeeks.org/convert-python-datetime-to-epoch/ - then
subtract the number, divide the resultant by 3600 (hours) & get the
modulus for minutes. There's probably a standard function - it should
be
you.M--(Unsigned mail
from my phone)
Original message From: Steve GS Date:
12/12/22 17:34 (GMT+10:00) To: python-list@python.org Subject: Subtracting
dates to get hours and minutes How do I subtract two time/dates and calculate
the hours and minutesbetween?Steve--
https
How do I subtract two time/dates and calculate the hours and minutes
between?
Steve
--
https://mail.python.org/mailman/listinfo/python-list
17 matches
Mail list logo