Results 1 to 2 of 2

Thread: requesting for a prog

  1. #1
    Join Date
    Dec 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default requesting for a prog

    does anyone hav a prog that helps calculate the next date for the current dates by entering the no. of days?
    for example.
    6th dec -- after 20 days -- the date will be 5th jan

    can anyone easily work up the needed code for me? I would greatly appreciate it! Thanks.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Well, this could be done with PHP.

    date('m/d/Y',(time()+($days*60*60*24)));

    Meaning display the date in month/day/year format represented by current_time plus $days (a variable, could be set to 20 in this case) times 60 (seconds) times 60 (minutes) times 24 (hours).

    The m/d/Y format is just one example... it can do a textual representation, etc.

    What this does is converts the day you're looking for to a unix timestamp (just a number of seconds since 1970, approx... can't remember the exact day... might be jan 1, 1970...) and then outputs (using default stuff) to a human-readable "date" format.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

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