Re: [PHP-DB] mktimestamp help

[email protected] ("Wesley Dukes")
Newsgroups php.db
Message-ID <[email protected]>
Try something like this:

$subscriptionDate = date("Y-m-d",time());  // format time() timestamp
$sixMonthsLater = date("Y-m-d", mktime(0,0,0, date("m")+6, date("d"),
date("Y"))); //mktime +6 to month

or even:

$oneYearLater = date("Y-m-d", mktime(0,0,0, date("m"), date("d"),
date("Y")+1)); //mktime +1 to year

~w

On Tue, Dec 30, 2008 at 5:43 PM, Ron <[email protected]> wrote:

> Hi,
>
> I'm trying to do online subscription on my site.
>
> I need to determine the expirationdate of the subscription, given the date
> today is the start of subscription and duration type of example 6 months.
>
> $subscriptiondate =
> date("Y-m-d",mktime(0,0,0,date('m'),date('d'),date('Y')));
>
> $expiredate = date("Y-m-d",mktime(0,0,0,date('m'),date('d'),date('Y')) +
> 2592000); the 2592000 timestamp for 1 month.
>
> how can i compute the timestamp for 6 months or maybe 1 year or more.
>
> Thank you
>
> Regards,
> Ron
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.