Top "Dateinterval" questions

Data type used for capturing a interval between two date objects.

Get a PHP DateTime difference in days, considering midnight as a day change

What is the simplest way to get the difference in days between two PHP DateTimes, considering midnight as a day …

php date datetime dateinterval
Calculating the difference between two dates in Swift

I've seen many approaches how to compute the difference between two dates in terms of a particular date component, e.…

ios swift date dateinterval
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
Add minutes to PHP Datetime to calculate start/end of event

I would like to calculate with PHP the start and end datetime of an event. I get the start of …

php dateinterval
How we can add two date intervals in PHP

i want to add two date intervals to calculate the total duration in hours and minutes in fact i want …

php datetime addition dateinterval
How to convert string duration to ISO 8601 duration format? (e.g. "30 minutes" to "PT30M")

There are plenty of questions asking how to do this the other way (converting from this format), but I can't …

php duration iso8601 dateinterval
Are PHP DateInterval comparable like DateTime?

I discovered that a DateTime object in PHP can be compared to another as the ">" and "<" operators are …

php datetime dateinterval
DateTime/DateInterval adding 25 hours each refresh gives a completely different result

Here is my code: $timezone = new \DateTimeZone('America/New_York'); $date1 = new \DateTime (date("Y:m:d H:i:s", …

php datetime dateinterval
How to retrieve the number of days from a PHP date interval?

I am trying to retrieve the number of days for a PHP interval. When I run the following piece of …

php dateinterval
Php Class 'DateInterval' not found

I am using php version 5.4.24 and I can't use the class DateInterval. I get this error: PHP Fatal error: Class …

php dateinterval