> beware of dates before 1969.
That problem mostly occurs on windows systems, and in fact it's dates
before 1 jan 1970 0:00 - php on windows will issue a warning if you
try to use dates like that
> > > Can anyone tell me how to convert a date stored in the format
> > > "-MM-DD" to an integer
beware of dates before 1969.
Justin French <[EMAIL PROTECTED]> wrote:
>
> Jason,
>
> This seems to work fine for me:
>
> $daysToAdd= 5;
> $secondsToAdd = $daysToAdd * 86400;
> $dateIn = "2004-07-24";
> $dateInStamp = strtotime($dateIn);
> echo date('m/d/Y h:i:s',$da
How is the date stored, MySQL db??? if so, you can select dates out as
unix timestamps. Otherwise i would use mktime or strtotime...
Jason
Jason FB <[EMAIL PROTECTED]> wrote:
>
> Can anyone tell me how to convert a date stored in the format
> "-MM-DD" to an integer of seconds since unix
Jason,
This seems to work fine for me:
... as does the more condensed version:
If strtotime() is returning -1, that means that it's having trouble
converting your -MM-DD date to a timestamp. The common pitfall is
that you've got the month and day mixed up (-DD-MM), or that you're
not
Jason FB wrote:
Can anyone tell me how to convert a date stored in the format
"-MM-DD" to an integer of seconds since unix epoc,
then add $daysToAdd days to this value (I suppose if the integer was a
number of seconds it would have to be $daysToAdd*60*60*24 to get the
number of seconds to a
Hi,
Try
$date="-MM_DD";
$da=explode("-",$date);
Now
$Y=$da['0'];
$M=$da['1'];
$D=$da['2'];
then use mktime();
Hope you will get the results.
zareef ahmed
--- Jason FB <[EMAIL PROTECTED]> wrote:
> Can anyone tell me how to convert a date stored in
> the format
> "-MM-DD" to an in
Can anyone tell me how to convert a date stored in the format
"-MM-DD" to an integer of seconds since unix epoc,
then add $daysToAdd days to this value (I suppose if the integer was
a number of seconds it would have to be $daysToAdd*60*60*24 to get
the number of seconds to add)
then conver
7 matches
Mail list logo