This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients belopolsky, brett.cannon, catlee, erik.stephens, guettli, jribbens, lemburg, skip.montanaro, steve.roberts, tim.peters, tomster, vstinner
Date 2008-11-14.11:46:26
SpamBayes Score 0.0001091188
Marked as misclassified No
Message-id <>
>>> (t - epoch) // timedelta(seconds=1)

I don't like this syntax, because I can't guess the result unit:
  datetime - datetime -> timedelta
  timedelta / timedelta -> seconds? days? nanoseconds?

If you example, you used timedelta(seconds=1), but what is the result 
unit if you use timedelta(hours=1)? or timedelta(days=1, 

The problem is that timedelta has no unit (or has multiple units), 
whereas timedelta.toseconds() are seconds. So about your example:

>>> (t - epoch).toseconds()
--> fractional seconds
>>> int((t - epoch).toseconds())
--> whole seconds
Date User Action Args
2008-11-14 11:46:27vstinnersetrecipients: + vstinner, lemburg, tim.peters, skip.montanaro, brett.cannon, jribbens, guettli, belopolsky, catlee, tomster, erik.stephens, steve.roberts
2008-11-14 11:46:27vstinnersetmessageid: <>
2008-11-14 11:46:26vstinnerlinkissue1673409 messages
2008-11-14 11:46:26vstinnercreate