Author vstinner
Recipients Alexander.Belopolsky, Arfrever, belopolsky, eric.smith, loewis, mark.dickinson, pitrou, skrah, vstinner
Date 2012-02-04.00:24:07
SpamBayes Score 4.16386e-06
Marked as misclassified No
Message-id <>
Even if some people dislike the idea of adding datetime.datetime type, here is a patch implementing it (it requires time_decimal-XX.patch). The patch is at least a proof-of-concept that it is possible to change the internal structure without touching the public API.


$ ./python
>>> import datetime, os, time
>>> open("x", "wb").close(); print(
2012-02-04 01:17:27.593834                                                                                                                  
>>> print(os.stat("x", timestamp=datetime.datetime).st_ctime)                                                                        
2012-02-04 00:17:27.592284+00:00                                                                                                            
>>> print(time.time(timestamp=datetime.datetime))                                                                                           
2012-02-04 00:18:21.329012+00:00
>>> time.clock(timestamp=datetime.datetime)
ValueError: clock has an unspecified starting point
>>> print(time.clock_gettime(time.CLOCK_REALTIME, timestamp=datetime.datetime))
2012-02-04 00:21:37.815663+00:00
>>> print(time.clock_gettime(time.CLOCK_MONOTONIC, timestamp=datetime.datetime))
ValueError: clock has an unspecified starting point

As you can see: conversion to datetime.datetime fails with ValueError('clock has an unspecified starting point') for some functions, sometimes depending on the function argument (clock_gettime).
Date User Action Args
2012-02-04 00:24:08vstinnersetrecipients: + vstinner, loewis, mark.dickinson, belopolsky, pitrou, eric.smith, Arfrever, skrah, Alexander.Belopolsky
2012-02-04 00:24:08vstinnersetmessageid: <>
2012-02-04 00:24:08vstinnerlinkissue13882 messages
2012-02-04 00:24:07vstinnercreate