Python - how to get a python datetime from a sql DateTime

moody31415moody31415 Posts: 8
edited July 20, 2015 5:15AM in SQL Data Generator
I'm trying to generate data from a previous column - basically I want to figure out "week starting" (eg, value is always a Monday) given a datetime column.

What I'd like to do is treat the SQL DateTime column as a python datetime ( ... me-objects), which would allow me to do this in a python script:

foo = otherColumn
dayOfWeek =

Of course, python doesn't have an AddDays, but I could use timedelta if necessary.

How do I convert a sql DateTime to a python datetime?



Sign In or Register to comment.