Top "Date-math" questions

Best way to find the months between two dates

I have the need to be able to accurately find the months between two dates in python. I have a …

python datetime monthcalendar date-math
PHP find difference between two datetimes

I'm trying to get the difference between two datetimes and return it as a datetime. I've found examples using diff …

php datetime date-math
Comparing dates in rails

Suppose I have a standard Post.first.created_at datetime. Can I compare that directly with a datetime in the …

ruby-on-rails datetime date-math
How to Subtract Days in MySQL

How can I subtract time in MySQL? For example, today is 16 March; I want to subtract 15 days to reach 1 March. …

mysql datetime days date-math
php Object of class DateInterval could not be converted to string

i've tried using date_diff and date_create to get a difference from two date that's already converted to string. …

php datetime date-math dateinterval
Return start and end of year given any year

I need two or one (out) C# method that will take any datetime and return the start date of year …

c# datetime date-math date-manipulation
How do I do date math in a bash script on OS X Leopard?

I realize I could whip up a little C or Ruby program to do this, but I want my script …

bash macos date-math
PHP get time difference in minutes

I looked around and nothing I saw quite worked with my database layout. Basically I need to take the current …

php date date-math
php strtotime in seconds and minutes

i use ths method to find the difference between two timestamp and get the number of seconds between those two …

php date strtotime date-math
easy way to add 1 month to a time_t in C/C++

I have some code that uses the Oracle function add_months to increment a Date by X number of months. …

c++ c date time-t date-math