On Mon, Feb 2, 2009 at 20:29, C M <cmpyt...@gmail.com> wrote:
> I'm doing some date plotting and make use of dateutil.  The version
> I have is given as 1.2-mpl and I believe it installed directly with the
> latest matplotlib installation.
>
> My problem is with dateutil's microsecond precision. An example:
>
>>>> date = '2009-01-11 03:55:23.255000'
>>>> d = dateutil.parser.parse(date)
>>>> d
> datetime.datetime(2009, 1, 11, 3, 55, 23, 254999)
>
> Note the microseconds of the datetime object are 254999,
> whereas the original date string given was 255000.  This matters
> to me in that I am matching to a database and would prefer to
> have the two values just match without further manipulation.
>
> I thought maybe newer versions of dateutil would have had this
> issue worked out.  I see there is a dateutil 1.4.1 available, here:
> http://labix.org/python-dateutil

Yes it's fixed:

$ python
Python 2.5.2 (r252:60911, Jan  4 2009, 21:59:32)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dateutil.parser
>>> dateutil.__version__
'1.4.1'
>>> date = '2009-01-11 03:55:23.255000'
>>> d = dateutil.parser.parse(date)
>>> d
datetime.datetime(2009, 1, 11, 3, 55, 23, 255000)

Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to