Results 1 to 3 of 3

Thread: Is This Possible?

  1. #1
    You do realize by 'gay' I mean a man who has sex with other men?
    Join Date
    Oct 2003
    Location
    New Orleans, Louisiana.
    Posts
    21,635

    Is This Possible?

    I want to include a php date function on a webpage however, i actually want to include say 3 or 4 individual date functions...

    What i want, lets say you are looking at the page today the date functions would show this...

    04-16-07 - Link One

    04-14-07 - Link Two

    04-12-07 - Link Three

    Now, if you looked at the page tomorrow, the date functions would show this...

    04-17-07 - Link One

    04-15-07 - Link Two

    04-13-07 - Link Three

    Basically, its the date function but it goes back 2,4 and 6 days when the date is displayed.

    Does that make sense? If so, how would i go about doing it, is it even possible?

    Regards,

    Lee


  2. #2
    On the other hand.... You have different fingers
    Join Date
    Feb 2004
    Location
    San Francisco
    Posts
    3,548
    I'm not a PHP programmer, but that should be mad simple.

    Dates in Linux are stored as a numeric value equal to the number of seconds since 1/1/1970. 24 hours = 86400 seconds. So all you should need to do is set each of your date values equal to those values, something similar to

    linkonedate = (today's date)

    linktwodate = (today's date) - (2*86400)

    linkthreedate = (today's date) - (4*86400)

    and then use whatver the PHP function to display a date is, such that date = linkthreedate or whatever.


  3. #3
    Life is a dick and when itīs get hard---just fuck it... DEVELISH's Avatar
    Join Date
    Jul 2005
    Posts
    2,367
    Is this what you want to do?

    Code:
    <?php
    $today = mktime();
    $tomorrow  = mktime(0, 0, 0, date("m")  , date("d")+1, date("Y"));
    $dayaftertomorrow = mktime(0, 0, 0, date("m")  , date("d")+2, date("Y"));
    
    echo date('m-d-y', $tomorrow );
    ?>
    for date formatting see http://www.php.net/manual/en/function.date.php

    :develish:
    :-D


Posting Permissions

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