Revision: 6619
http://jython.svn.sourceforge.net/jython/?rev=6619&view=rev
Author: pjenvey
Date: 2009-08-01 19:36:10 +0000 (Sat, 01 Aug 2009)
Log Message:
-----------
carry over nanoseconds in datetime to Timestamp conversions
Modified Paths:
--------------
trunk/jython/Lib/datetime.py
Modified: trunk/jython/Lib/datetime.py
===================================================================
--- trunk/jython/Lib/datetime.py 2009-07-31 19:20:24 UTC (rev 6618)
+++ trunk/jython/Lib/datetime.py 2009-08-01 19:36:10 UTC (rev 6619)
@@ -1853,12 +1853,14 @@
calendar.clear()
calendar.set(self.year, self.month - 1, self.day,
self.hour, self.minute, self.second)
- calendar.set(Calendar.MILLISECOND, self.microsecond // 1000)
if java_class == Calendar:
+ calendar.set(Calendar.MILLISECOND, self.microsecond // 1000)
return calendar
else:
- return Timestamp(calendar.getTimeInMillis())
+ timestamp = Timestamp(calendar.getTimeInMillis())
+ timestamp.setNanos(self.microsecond * 1000)
+ return timestamp
datetime.min = datetime(1, 1, 1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|