Solved

Date difference - calculate days

Posted on 2013-12-21
2
340 Views
Last Modified: 2013-12-22
I have the following and need to calculate days between the start and end date

$start=ISODate("2013-12-22T04:26:57.140Z");
$end=ISODate("2013-11-22T04:26:57.140Z");

I need to do this in php with the iso date format as above
0
Comment
Question by:debbieau1
2 Comments
 
LVL 16

Accepted Solution

by:
Peter Kwan earned 500 total points
ID: 39734334
You may use the following:

$start="2013-12-22T04:26:57.140Z";
$end="2013-11-22T04:26:57.140Z";
echo abs(strtotime($end)-strtotime($start)) / (24*60*60);

Open in new window

0
 
LVL 1

Author Closing Comment

by:debbieau1
ID: 39734406
Thanks
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now