Top "Python-datetime" questions

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

How can I get the previous week in Python?

I am currently getting the current week starting on Monday and ending on Sunday but how can I get the …

python python-2.7 python-datetime
Why is pandas.to_datetime slow for non standard time format such as '2014/12/31'

I have a .csv file in such format timestmp, p 2014/12/31 00:31:01:9200, 0.7 2014/12/31 00:31:12:1700, 1.9 ... and when read via pd.read_csv and convert the …

python csv pandas python-datetime string-to-datetime
Get week number using date in python

Date is datetime.date(2013, 12, 30) I am trying to get week number using import datetime datetime.date(2013, 12, 30).isocalendar()[1] I am getting …

python datetime iso8601 week-number python-datetime
Adding years in python

If I want to add 100 years in my program, why is it showing the wrong date? import datetime stringDate= "January 10, 1920" …

python datetime python-3.x python-datetime
Given a date range how can we break it up into N contiguous sub-intervals?

I am accessing some data through an API where I need to provide the date range for my request, ex. …

python python-2.7 date python-datetime
Pandas: convert date in month to the 1st day of next month

I am wondering if there are any efficient methods or one-liner that, given a pandas DatetimeIndex date1, return a DatetimeIndex …

pandas python-datetime
Add time to datetime

I have a date string like this and then use strptime() So its like this my_time = datetime.datetime.strptime(…

python datetime time python-datetime
argument must be 9-item sequence, not datetime.datetime

Web app is breaking on the following line; start_time = int(time.mktime(start)) * 1000 The error is a TypeError - …

python time mktime python-datetime
How can i check if date is on range on Python?

I'm trying to check if today's date (in dd-mm-yyyy format) is in a given range. My code only checks the …

python python-2.7 datetime python-datetime
SqlAlchemy filter by time difference

I'm new (but not so new) to SQLAlchemy. I'm using version 0.9.3 for a project. I want to make a query …

python time orm sqlalchemy python-datetime