I want to create a datetime column in a feature class from a string field. The string field has this format: "%Y-%m-%dT%H:%M:%S" (for example: "2023-10-16T07:50:00"). When I use the gp tool "ConvertTimeField", some (about 10%) columns contain milliseconds, but the string does not contain milliseconds.
For example: string: 2023-10-16T07:50:25; output time: 10/16/2023 07:50:24; datetime object: datetime.datetime(2023, 10, 16, 7, 50, 24, 999000)
This also occurs when converting the time with "datetime.datetime.strptime()" when I run the script in the ArcGIS Pro Python window. If I use the same code from the script in ArcGIS Notebooks and Visual Studio Code, it works correctly.
Does anyone know this problem and can help me?
Thomas