Solved

Date difference - calculate days

Posted on 2013-12-21
2
344 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

730 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