## Calculate the number of days between 2 dates - PHP

 web Calculate the number of days between 2 dates - PHP
# 1
Calculate the number of days between 2 dates - PHP

Is this code good for this purpose?

 kovacsakos View Public Profile for kovacsakos Find all posts by kovacsakos
# 2
It looks quite correct.
This User Gave Thanks to Corona688 For This Post:
 Corona688 View Public Profile for Corona688 Visit Corona688's homepage! Find all posts by Corona688
# 3
Actually, on second look -- there is an issue with leading zeroes.

 Corona688 View Public Profile for Corona688 Visit Corona688's homepage! Find all posts by Corona688
# 4
Thanks for your help!
 kovacsakos View Public Profile for kovacsakos Find all posts by kovacsakos

## Get number of days between 2 dates

Gents. Please can u help. I would like to calculate the days between two dates. Example file1 ( previous date) file1 - Input file 9/29/2010 10195 9/29/2010 1057 2/2/2016 10 2/2/2016 10169 2/2/2016 1057 2/3/2016 10005 2/3/2016 10014 In file2 I add the actual date using this code....

## How to Calculate the difference between two dates?

I want the difference between two following date using scripts in terms of no.of days. How I can accomplish this. lastdate=Tue Nov 13 10:30:56 2012 currdate=Wed Dec 15 15:58:21 PAKST 2012 Ouput should be like this: Your Password will expire after = 32 Days on Wed Dec 15 15:58:21 PAKST...

## Calculate the number of days between 2 dates - bash script

I wrote the day calculator also in bash. I would like to now, that is it good so? #!/bin/bash datum1=`date -d "1991/1/1" "+%s"` datum2=`date "+%s"` diff=\$((\$datum2-\$datum1)) days=\$((\$diff/(60*60*24))) echo \$days Thanks in advance for your help!

## Calculate days between yyyyMmmdd dates on Solaris

I extract dates from the log file and need to calculate days between two dates. My dates are in yyyyMmmdd format. Example: \$d1=2011 Oct 21 \$d2=2012 Feb 20 I need to calculate the number of days between \$d2 and \$d1. This is on Solaris. Any ideas? Thanks, djanu

## days are between the two dates?

I have two times in the format of YYMMDD. Does anyone know an easy way in ksh for me to display how many days are between the two dates? Example1: X=101202 Y=101205 There are 3 days between X & Y Example2: X=101202 Y=111202 There are 365 days between X & Y Example3: X=101205...

## Get number of days between given dates

Hi I need one single command to get number of days between two given dates.datecalc is not working. ex. fromdate:01.04.2010 todate :24.04.2010 i should get the out put as 23 Thanks in advance

## calculate the number of days left in a month

does any one have any ideas how i would go about calculating the number of days left in the month from a bash script ?. I want to do some operations on a csv file according to the result

## How to calculate specific hours between 2 dates

Hi there, I am trying to find out a way to calculate how many hours are between 2 dates but from a specific time range, actually working hours (Monday to Friday 09:00 - 18:00). What I mean is for example date1 = Monday 21 July 2008 22:00:00 so in python 2008-07-21 22:00:00 date2 = Wednesday...

## Number of days between two distinct dates

Hi I'm looking for a .ksh script/function that will calculate ONLY the number of days between two distinct dates. Further convert the number of days to weeks and display. I need this to be part of another larger script that checks the password expiry on several servers and notifies the...

## Find number of days and list out the dates in between

Hi All, Can unix cshell list out the number of days between 070201 and 070205 (format is yymmdd) and list out all the dates in between in similiar format. set startdate = `date '+%y%m%d'` #eg 070201 set enddate = `date '+%y%m%d'` #eg 070205 i would expect the number of days to be 5...