Top "Python-datetime" questions

Python's built-in datetime module provides classes for manipulating dates and times in both simple and complex ways.

Django model DateTimeField set auto_now_add format or modify the serializer

I have this field in my model: createdTime = models.DateTimeField(_('Creation date'), help_text=_('Date of the creation'), auto_now_…

python django datetime serialization python-datetime
Converting UNIX time to datetime object in Jinja templates

I want to convert my timestamp to datetime in jinja2.. here's my sample code: import time date = time.time() self.…

python google-app-engine timestamp python-datetime
combining datetime.datetime with datetime.time - TypeError: an integer is required

I am currently attempting to iterate through some data contained in an SQL request cursor, alter the type of some …

python datetime python-datetime
convert python datetime with timezone to string

I have date time tuples in the format of datetime.datetime(2010, 7, 1, 0, 0, tzinfo=<UTC>) How can I convert that …

python django python-datetime
Convert date format python

I have django form and I am receiving from POST a date formated like "%d/%m/%Y" and I would …

python django python-datetime
Convert pandas datetime month to string representation

I want to have a pandas DataFrame with a timestamp column and want to create a column with just the …

python pandas python-datetime
Python select random date in current year

In Python can you select a random date from a year. e.g. if the year was 2010 a date returned …

python python-datetime
python compare datetimes with different timezones

I'm implementing feature with scheduled publishing of object. User chooses the time to publish and i created a cron task …

python python-2.7 python-datetime
get lastweek dates using python?

I am trying to get the date of the last week with python. if date is : 10 OCT 2014 means It should …

python datetime python-3.x scrapy python-datetime
Is there an easy way to convert ISO 8601 duration to timedelta?

Given a ISO 8601 duration string, how do I convert it into a datetime.timedelta? This didn't work: timedelta("PT1H5…

python datetime timedelta python-datetime