Untitled
Anonymous
Python
11/29/2026 5:11 AM
367 B
7
Indexable
Never
from datetime import datetime
now = datetime(2026, 11, 28, 23, 10)
target = datetime(2026, 11, 30, 8, 30)
diff = target - now
total_seconds = diff.total_seconds()
hours = total_seconds / 3600
whole_hours = int(total_seconds // 3600)
minutes = int((total_seconds % 3600) // 60)
print(f"Total hours: {hours:.2f}")
print(f"{whole_hours} hours and {minutes} minutes")
Editor is loading...
Leave a Comment