CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Add (+) minus(-) two different date

Print topic Send  topic

Author Message
mohamedazmi

Posts: 13
Posted: 04/04/2011, 5:44 PM

Can some one help me, total number of day from two different date
View profile  Send private message
saseow

Posts: 744
Posted: 04/04/2011, 9:24 PM

I presume that you want the number of days between two dates. Try something like this where $start is the first date and $end is the last date:

$start_ts = strtotime($start);
$end_ts = strtotime($end);
$diff = $end_ts - $start_ts;
return round($diff / 86400);
View profile  Send private message
Waspman

Posts: 948
Posted: 04/05/2011, 12:16 AM

where are your original dates to compare coming from?


_________________
http://www.waspmedia.co.uk
View profile  Send private message
mohamedazmi

Posts: 13
Posted: 04/05/2011, 12:19 AM

i have 2 column (date)
View profile  Send private message
Waspman

Posts: 948
Posted: 04/05/2011, 5:16 AM

so they are coming from the page?

jjrjrr1 (?) sorted this when he explained how CCS converts dates to an array before presentation.

go here;

http://forums.yessoftware.com/posts.php?post_id=97052
_________________
http://www.waspmedia.co.uk
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.