Selisih waktu di PHP

June 22, 2012 at 10:42 am Leave a comment

Dari pada galau, bagusan saya tulisa saja, biar gak lupa.

Sesuai judul, saya mau tulis script sederhana untuk mencari selisih waktu antara dua tanggal, misalnya dari 10 juni 2012 – 30 juni 2013 itu berapa hari selisihnya. Oke, Here is  the script :

$startdate= 10/06/2012

$endate = 10/06/2013
list($day,$month,$year)=explode(“/”, $startdate);
$start=mktime(0,0,0,$month,$day,$year);

list($day,$month,$year)=explode(“/”, $endate);
$end=mktime(0,0,0,$month,$day,$year);

$getdiff=$end-$start;
$difftoday=$diff/86400;

Oke deh, begitu kira2.

Entry filed under: PHP. Tags: .

List Permintaan untuk ketemuan Saya ! Doing Something More !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Because I Learn CI and Jquery

http://api.jquery.com

http://www.grocerycrud.com

http://Zedwood.com

Twitter Updates

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

My FB page


%d bloggers like this: