Results 1 to 3 of 3

Thread: date

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Posts
    8

    date

    how can i get date of last tuesday?
    how can ig et the date of the 5th of month?
    how can i get the date of first fridya?

    thansk

  2. #2
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    how can you not learning anythign if you don't read the manual

    look up strtotime();

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    Re: date

    Originally posted by php_n00b
    how can i get date of last tuesday?
    Use the strtotime() function:

    Code:
    <?php
        echo "Last Tuesday: " .  date('m-d-Y', strtotime("last tuesday"));
    ?>
    Originally posted by php_n00b
    how can ig et the date of the 5th of month?
    Huh?

    Code:
    <?php
        echo "Fifth of the month: " . date('m-d-Y', strtotime("04-05-03"));
    ?>
    Originally posted by php_n00b
    how can i get the date of first fridya?
    Again, strtotime():

    Code:
    <?php
        echo "First Friday: " .  date('m-d-Y', strtotime("first friday"));
    ?>

    Originally posted by php_n00b
    thansk
    I suggest you go to these sites and read them:
    http://www.php.net/manual/en/function.date.php
    http://www.php.net/manual/en/function.strtotime.php

    If English isn't your native language, which I suspect it isn't, they have the manual available in a wide variety of tongues.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width