473,671 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why no time() + timedelta() ?

Why can't timedelta arithmetic be done on time objects?

(e.g. datetime.time(5 )-datetime.timede lta(microsecond s=3)

Nonzero "days" of the timedelta could either be ignored, or trigger an exception.

Jul 18 '05 #1
0 1208

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1313
by: josh | last post by:
datetime.time should support timedelta arithmetic, patch attached. Times greater than 24 hours should not raise an exception, but always wrap around. Any other behavior is too surprising. (People expect to be able to call you up at 11pm, and say "meet me in two hours" (if you're a night person)). Clock time is cyclical. Though it's convenient to assign hours numbers, an unqualified hour 23.5 is not naturally "greater than" hour 0.5....
1
6861
by: Philipp | last post by:
Hello Pythonistas I'm new to Python, I hope you understand my question. I would like to pass a parameter "gap" to a function. gap should be used there to create a timedelta Object. from datetime import * def f(gap): print (datetime.now() + datetime.timedelta(gap))
5
10569
by: kpp9c | last post by:
Hi, I was looking at python & datetime and hoping that it would already have a method/func to translate time formats. I need to translate seconds to hh:mm:ss.ms and vice versa and would like the ability to do some basic arithmetic in these formats. I think that there just has to be a package or module out there that already does this with reasonable speed and accuracy.
5
28441
by: Lad | last post by:
Hello, what is the best /easest way how to get number of hours and minutes from a timedelta object? Let's say we have aa=datetime.datetime(2006, 7, 29, 16, 13, 56, 609000) bb=datetime.datetime(2006, 8, 3, 17, 59, 36, 46000) so c=bb-aa will be datetime.timedelta(5, 6339, 437000)
2
13988
by: kath | last post by:
Hi, the following shows the contents of "datebook.xls" Date 8/9/2006 8/9/2006 8/9/2006 8/9/2006 8/9/2006
3
1545
by: ian | last post by:
Hi, i have a problem with time in python. 1) i got 2 values from mysql db (fields are "time" type) 2) python get it as "<type 'datetime.timedelta'>" (why timedelta???) 3) i need to compare 2 fields with actual time ... EG: if ArrOutputsAuto.TimeFrom >= GNow and ArrOutputsAuto.TimeTo <= GNow: i need actual time, and 2 fields from DB in datetime.time type (correct me
2
4302
by: skip | last post by:
Running from Subversion, I see confusing (to me) behavior related to division of datetime.timedelta objects by integers: % python Python 2.6a0 (trunk:57277:57280M, Aug 28 2007, 17:44:49) on darwin Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for /: 'datetime.timedelta' and 'int'
6
2426
by: Jeremy Sanders | last post by:
Hi - I need to add support to a program for dates and times. The built-in Python library seems to be okay for many purposes, but what I would like would be Unix epoch style times (seconds relative to some date), covering a large period from the past to the future. What would be nice would be a library which can take floating point seconds from an epoch. Does anyone know of a library which can convert from human style dates and times to a...
11
2424
Zwoker
by: Zwoker | last post by:
Hi All, I'm using MS Access 2003. I have been trying to find out why portions of my VBA code have been running slower than expected, using code like the following: Dim StartTime, EndTime As Date Dim TimeDelta As Single StartTime = Time <Call some procedure>
0
8393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8598
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7437
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6229
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2812
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1809
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.