PHP Tutorial : Parse english time into unix timestamp

hello,
Sometime I discovered a very “pretty” php function which parses about any english date/time into unix timestamp. I used it to calculate dates, like adding 1 more day to a date or 1 year who cares. Also, I used to merge it back into “normal” format like dd.mm.yyyy

<?php
//isn't it simple ?
$oneyear = strtotime("+1 year");
$oneday = strtotime("+1 day");
//merge those into normal date format
$oneyear = date("d.m.Y", $oneyear);
print $oneyear;
$oneday = date("d.m.Y", $oneday);
print $oneday;
?>
This entry was posted in Basic PHP and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>