Hi everybody,
here is the code which does unfortunatelly not work as I want. The goal is
to produce a unix timestamp which is a date 7 days ago and one 14 days ago
and so on.
code:
switch ($ts){
case 1: // today
$timestamp = mktime (0,0,0,date("m") ,date("d"),date("Y"));
break;
case 2: // yesterday
$timestamp = mktime (0,0,0,date("m"),date("d")-1, date("Y"));
break;
case 2: // last week
$timestamp = mktime (0,0,0,date("m"),date("d")-7, date("Y"));
break;
}
Maybe someone can see the error?
Thank you for any help on that.
Andy
<[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You should use mktime()
>
> mktime
> (PHP 3, PHP 4 )
>
> mktime -- Get UNIX timestamp for a date
> Description
> int mktime ( int hour, int minute, int second, int month, int day, int
year
> [, int is_dst])
>
> www.php.net/mktime
>
> --
>
> Nicos - CHAILLAN Nicolas
> [EMAIL PROTECTED]
> www.WorldAKT.com - H�bergement de sites Internet
>
> "Andy" <[EMAIL PROTECTED]> a �crit dans le message de news:
> [EMAIL PROTECTED]
> > Hi everybody,
> >
> > I am trying to create a unix timestamp which dates back a certain amount
> of
> > days. Lets say I would like to have a unix timestamp from 7 days ago.
> >
> > what I tryed is just to subtract values since this are counted s since
the
> > start of the unix epoche, but this does not work in cases like the
switch
> of
> > months. Has anybody an idea how to do that?
> >
> > Thanx, Andy
> >
> >
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php