Hi All,
I am trying to do a very simple thing : to use mkdate() as follows :
$date=mktime (0,0,0,date("m"),date("d"),date("Y"));
echo $date

WHAT I GET ON THE SCREEN IS : 1056610800
That is deffenelty not today's date..at least not in any format i am able to undersatnd.
ANY ideas why /what /how...?
Thanx,
Sofia

    Hi all again,
    I found something interesting, apparently it is a bug in php...ANY IDEA HOW TO FIX THIS??????

    look at the following posting i found :

    ID: 1069
    User Update by: tjones@northstar.k12.ak.us
    Old-Status: Closed
    Status: Open
    Bug Type: Misbehaving function
    Description: using leading zeros in mkdate gives incorrect timestamp

    Big OOPS, should be mktime not mkdate!

    ./configure --with-apache=../apache_1.3.3 --with-mysql --with-ldap --with-imap -
    -with-zlib --enable-sysvshm=yes --enable-sysvsem=yes --with-config-file-path

    default php.ini file

    <?
    $futureDay = mktime(0,0,0,4,8,1999);
    $futureDay1 = mktime(0,0,0,4,08,1999);

    <LI>(<? echo date("l F dt\h Y", $futureDay); ?>,<? echo $futureDay ?>)
    <LI>(<? echo date("l F dt\h Y", $futureDay1); ?> <? echo $futureDay1; ?>)
    ?>

    result is
    (Thursday April 08th 1999,923558400)
    (Wednesday March 31th 1999 922870800)

    Full Bug description available at: http://ca.php.net/bugs.php3?id=1069

    ANY IDEA HOW TO FIX THIS??????

      I figured out that it is unix representation..to convert they tell to use time() -
      however, that still doesn't work!
      IDEAS?

        Ok, i am still trying:

        $day=date(d);
        $month=date(m);
        $year=date(Y);
        $date = strftime ("%d %m %Y", mktime ,0,0,$day,$month,$year));
        echo $date;

        NOW the date it prints is "06 02 2005" ??? HOW???

          WORKS!!! - for all those who might have the problem in the future :

          $day=date(d);
          $month=date(m);
          $year=date(Y);
          $date = strftime ("%d %m %Y", mktime (0,0,0,$month,$day,$year));
          echo $date;

            Nothing like working hard to resolve your own issues ;-) Feels gratifying... I have the code you needed right here, but didn't get to your post in time, sorry... Oh well, "Catch a man a fish, he will eat for a day; Teach a man to fish, and he will feed himself for life" Good Job soniared!

              Write a Reply...