Re: trabajar con fechas
| From: | Raül Basanta Bayo | Date: | Thu, 24 Apr 2003 11:30:45 +0000 |
| Subject: | Re: trabajar con fechas | ||
| References: | 1 2 3 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-35470@lists.php.net to get a copy of this message | ||
Hola:
En el manual php, he buscado getdate() y entre los ejemplos y
aportaciones, encuentro:
"To do comparisons on dates stored in mysql db against 7 days ago, 1
month ago etc use the following:
$last_week = date("Y-m-d", mktime(0,0,0, date(m), date(d)-7,date(Y)));
//if($date > $last_week)
//{
//etc.
//This allows for intelligent looping i.e. works at start/end of
month/year
//I have noticed other postings re this and they have not worked for
me.Hope this helps. "
Si cambio $last_week por $next_month y date(d)-7 por date (d) y añado
date(m)+1, me parece que funciona.
Salu2.
Pd: No se escribe esactamente, sino exactamente.
----- Original Message -----
From: "Manuel Rodriguez Morales" <manu@sevillaconsulting.com>
To: <lista@phpes.com>
Sent: Thursday, April 24, 2003 1:15 PM
Subject: Re: [PHP-ES] trabajar con fechas
> ya lo hice, y no viene lo que yo kiero esactamente
> a ver, si yo hago
> $fecha=getdate();
> y tengo la fehca en ese formato
> como le sumo el mes?
>