6 Answered Questions for the topic datetime
Determine Whether Two Date Ranges Overlap?
Given two date ranges, what is the simplest or most efficient way to determine whether the two date ranges overlap?As an example, suppose we have ranges denoted by DateTime variables `StartDate1`... more
How to get the current time in Python?
What is the module/method used to get the current time?
Get current time in seconds since the Epoch on Linux, Bash?
I need something simple like `date`, but in seconds since 1970 instead of the current date, hours, minutes, and seconds. `date` doesn't seem to offer that option. Is there an easy way?
End of month calculations?
Just wondering if any know of an elegant solution for the following. If I have 30 June 2009 and I add a month I want it to go to 31 July 2009, not the 30 July 2009. This logic is based on the... more
Converting string into datetime?
Short and simple. I've got a huge list of date-times like this as strings: Jun 1 2005 1:33PM Aug 28 1999 12:00AMI'm going to be shoving these back into proper datetime fields in a database... more