Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #65900
| References | <CA+FnnTxV_VKbSkcdpAnPckUs95j3038emhwEhCbjCweMe=ZeCQ@mail.gmail.com> |
|---|---|
| Date | 2014-02-11 12:11 +0100 |
| Subject | Re: Get a datetime with nanoseconds |
| From | Vlastimil Brom <vlastimil.brom@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.6661.1392117075.18130.python-list@python.org> (permalink) |
2014-02-11 6:42 GMT+01:00 Igor Korot <ikorot01@gmail.com>: > Hi, ALL, > I am woking on an application for digital forensic. > In this application I am getting this 2 pieces of information: > > atime - long representing the time stamp > atime_nano - long representing the nanoseconds. > > What I'd like to do is to have a python datetime object which will be a > representation of those 2 values. > I can get a datetime object out of atime timestamp, but I don't know how to > do it for atime_nano. > > I did a little research. It looks like people on SO are saying that I will > not be able to get this kind of precision, but I'd be grateful if I can at > least get the best possible precision (millioseconds?) it would be great. > > Thank you for any pointers. > > -- > https://mail.python.org/mailman/listinfo/python-list > Hi, it seems, datetime has support for microseconds datetime.datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None) http://docs.python.org/3.3/library/datetime.html#datetime.datetime I haven't done anything using this precision, but I guess, microseconds could be used out of the box; for some higher precision, you'd probably need to code your own datatype. hth, vbr
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Get a datetime with nanoseconds Vlastimil Brom <vlastimil.brom@gmail.com> - 2014-02-11 12:11 +0100
csiph-web