Linked Questions

6 votes
3 answers
15k views

My datetime data is like this: 2016-03-01 19:25:53.053404 I am trying to use datetime.strptime(date, "%Y-%m-%d %HH:%MM:%SS") But I get this error: ValueError: time data '2016-03-01 19:24:35....
apadana's user avatar
  • 14.9k
0 votes
1 answer
1k views

This question is very similar to this SO, but my data is on the form: '13-04-2018 14:06:26.866' '13-04-2018 14:06:27.131' '13-04-2018 14:06:27.404' '13-04-2018 14:06:27.674' ... i.e. the seconds are ...
Faur's user avatar
  • 5,998
2 votes
1 answer
362 views

I have a following datetime: d1 = 2015-03-21 14:50:54.0. While doing datetime.strptime(d1, "%Y-%m-%d %H:%M:%S") I get an error that ValueError: unconverted data remains: .0. How can I add ...
Bob's user avatar
  • 10.9k
-1 votes
1 answer
108 views

How to convert "2013-10-21 12:00:00.004" to datetime object in Python? The problem is there is decimal number in seconds.
user5025141's user avatar
-1 votes
1 answer
87 views

i am reading a entrance time from sqlite database to calaulate the duration of the car stay. the datetime is currenly able to insert and retrive but when formated to do calualtion it keeps give an ...
user19683237's user avatar
1 vote
0 answers
24 views

From some sensor I obtained very precise time measurement given as this: time_str = '2019-07-03T20:03:51.520273066Z' Using the datetime library, I'm trying to convert it to datetime object: time_obj ...
errno98's user avatar
  • 332
308 votes
18 answers
204k views

By default logging.Formatter('%(asctime)s') prints with the following format: 2011-06-09 10:54:40,638 where 638 is the millisecond. I need to change the comma to a dot: 2011-06-09 10:54:40.638 To ...
Jonathan Livni's user avatar
11 votes
2 answers
25k views

Trying to figure out datetime module and need some help. I've got a string which looks like this: 00:03:12,200 --> 00:03:14,316 (that is hours:minutes:seconds,milliseconds) and need to add let's ...
user63503's user avatar
  • 6,513
3 votes
2 answers
1k views

I have the following date string: dtstr = '2010-12-19 03:44:34.778000' I wanted to convert it to a datetime object, so i proceeded as follows: import time from datetime import datetime dtstr = '...
Joe's user avatar
  • 33
1 vote
2 answers
2k views

I have a string lfile with a datetime in it (type(lfile) gives <type 'str'>) and a Python datetime object wfile. Here is the code: import os, datetime lfile = '2005-08-22_11:05:45.000000000' ...
edesz's user avatar
  • 12.5k
5 votes
1 answer
2k views

MySQL 5.6.4 and up expands fractional seconds support for TIME, DATETIME, and TIMESTAMP values, with up to microseconds (6 digits) precision: http://dev.mysql.com/doc/refman/5.6/en/fractional-seconds....
allcaps's user avatar
  • 11.3k
0 votes
2 answers
2k views

I am playing around with python and I am trying to figure out a way to search a text file for a specific word within a time range. The file has time stamps, however since the file is a text file ...
user6534872's user avatar
1 vote
2 answers
755 views

I see how How can I parse a time string containing milliseconds in it with python? provides a solution when parsing a full timestamp and Is there an inverse function for time.gmtime() that parses a ...
Janus Troelsen's user avatar
0 votes
1 answer
590 views

I have the following datetime values in dask dataframe saved as string dates: ddf = dd.DataFrame({'date': ['15JAN1955:13:15:27.369', NaN,'25DEC1990:23:18:17.200', '06MAY1962:02:55:27.360', NaN, '...
doubleD's user avatar
  • 269
0 votes
1 answer
234 views

I have this datetime 2011-07-02 03:03:32.793 To deal with the millisecond issue with python 2.5 version(mentioned here), I try to truncate it & convert it date time as: import_transform: '...
asdf_enel_hak's user avatar

15 30 50 per page