Kamis, 23 Juli 2015

PHP : How To Get Date After 30 Days

It is very easy to do, just by using the built-in function of PHP, the name is date function and strtotime function.
Let me show how to do it:

<?php
$result_date1 = date("Y-m-d",strtotime("+30 days"));
// $result_date1 is date after 30 days from current date

$date = "2015-07-23";
$result_date2 = strtotime('+30 days',$date);
// $result_date2 is date after 30 days from 2015-07-23
?>
Share it Please

0 komentar:

Posting Komentar

Copyright @ 2013 Web Attribute. Designed by Templateism | Love for The Globe Press