mktimestamp help

mktimestamp help

am 31.12.2008 02:43:41 von ron

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

Re: mktimestamp help

am 31.12.2008 02:50:21 von Trullo

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ron 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
>

mktimestamp? is this a new kind of function?
try strtotime*, then you will be able to 'compute' dates

* http://es.php.net/manual/en/function.strtotime.php
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)

iEYEARECAAYFAklaz90ACgkQcm5XIl6hZIhZvQCfQ+bvkuvsPYU9x4Fz503D rpdt
Q8EAnjsCEufDqo86CzVZ7jLrDR1wyNCH
=0FtA
-----END PGP SIGNATURE-----

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: mktimestamp help

am 31.12.2008 02:55:31 von Wesley Dukes

------=_Part_111989_19488789.1230688531181
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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 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
>
>

------=_Part_111989_19488789.1230688531181--

Re: mktimestamp help

am 31.12.2008 03:05:37 von Trullo

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Wesley Dukes wrote:
> 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 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
>>
>>
>

you dont need to call date() 4 times plus mktime plus sum some integers,
just call strtotime once with some nice parameter and it will 'compute'
the result.
think green!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)

iEYEARECAAYFAkla03EACgkQcm5XIl6hZIicbACfVbWgUG/ET5n9WhcCE0+I RwSD
Me0An0tCAx0JhFiBAkz+oDlUTvwQxxgQ
=b7Re
-----END PGP SIGNATURE-----

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: mktimestamp help

am 31.12.2008 03:13:19 von Phpster

$endDate = date('Y-m-d', strtotime("+6 months");

Should be close


Bastien

Sent from my iPod

On Dec 30, 2008, at 8:43 PM, Ron 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
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: mktimestamp help

am 31.12.2008 03:30:11 von ron

Thanks i will try strtotime.


Phpster wrote:
> $endDate = date('Y-m-d', strtotime("+6 months");
>
> Should be close
>
>
> Bastien
>
> Sent from my iPod
>
> On Dec 30, 2008, at 8:43 PM, Ron 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
>>
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php