2014-04-22 4:38 GMT+02:00 Igor Korot <ikoro...@gmail.com>: ... >>>> datetime.datetime.fromtimestamp(1092787200/1000.0) > datetime.datetime(1970, 1, 13, 7, 33, 7, 200000) > > Is there a way to know if the timestamp has a microseconds? > > Thank you. > -- Hi, I believe, in these cases, you can just test, whether there is a non-integer part in the timestamp in seconds, which will be stored as microseconds accordingly. >>> 1092787200/1000.0 1092787.2 0.2 s is stored (and shown in repr(...)) as 200000 microseconds.
There are some peculiarities in handling date and time calculations reliably as well as in the floating point math, but they don't seem to be involved here. -- https://mail.python.org/mailman/listinfo/python-list