Hey all, I’m using a calendar entry to populate a datetime column in an SQL database. The format of the calendar entry is Month/Day/Year HH:MM. When the operator selected date is entered into the SQL table, I want to the seconds/milliseconds to be at 0. So 12/1/201 11:05 is entered into the table with 0 seconds, 0 milliseconds.
How can I set those values to 0 upon database entry?
I am using a button with a python script to create an insert query to put the data into a table.
Your database doesn’t format your column like DATE HH:MM:SS automatically when you select? If I insert something like ‘2014-11-25 11:57’ into a timestamp column (postgres), I still get ‘2014-11-25 11:57:00’ when I select. Similarly, if I insert ‘2014-11-25’, I get back ‘2014-11-25 00:00:00’ when I select.
The issue was related to how I was initializing the calendar date. It was capturing the current time + 5 minutes. This where I was getting the additional seconds/milliseconds. I’m now doing a CONVERT() function on the initialization.