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 <1226663187.48.0.176355231671.issue1673409@psf.upfronthosting.co.za>
In-reply-to
Content
>>> (t - epoch) // timedelta(seconds=1)

I don't like this syntax, because I can't guess the result unit:
  datetime - datetime -> timedelta
but:
  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, 
microseconds=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
History
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: <1226663187.48.0.176355231671.issue1673409@psf.upfronthosting.co.za>
2008-11-14 11:46:26vstinnerlinkissue1673409 messages
2008-11-14 11:46:26vstinnercreate