0

Using datetime.strptime(11/12/18 02:20 PM, '%m/%d/%y %I:%M %p') I enter the date and time into sql server using a stored procedure and I get no errors, all seems fine. But the actual value in the database when checked is 2018-11-12 00:00:00.000. This is the value coming out of strptime 2018-11-12 14:20:00. Why am I not getting the time value? I have checked both the table design and Stored Procedure to make sure that datetime is being used throughout.

1 Answers1

0

Ok, Figured it out, since I was doing this in 'Ignition' and using a python library, I went into the library file. It was using 'system.db.createSPProcCall' and 'registerInParam' where you must include a value and a type. Since 'system.db.type' does not have a datetime, they had used DATE, wrong! I changed it to use TimeStamp. It worked fine after that. A shout out to @Jeffrey Van Laethem for setting me on the right path.