Message152571
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.
Example:
$ ./python
>>> import datetime, os, time
>>> open("x", "wb").close(); print(datetime.datetime.now())
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:08 | vstinner | set | recipients:
+ vstinner, loewis, mark.dickinson, belopolsky, pitrou, eric.smith, Arfrever, skrah, Alexander.Belopolsky |
2012-02-04 00:24:08 | vstinner | set | messageid: <1328315048.67.0.231205738361.issue13882@psf.upfronthosting.co.za> |
2012-02-04 00:24:08 | vstinner | link | issue13882 messages |
2012-02-04 00:24:07 | vstinner | create | |
|