For example, I have an input from a csv which is 08:00:00 so this is in string type.
and I have a timefield in the model. I need to insert that string in the timefield. Is there an efficient way of converting this and inserting it into a timefield? I know something but it’s kinda like a long way.
For example, I have an input from a csv which is 08:00:00 so this
Share
You can convert it by using the
datetimemodule of pythonNote the year, month, day will start from
1900-01-01because there is no date information available in the string.