-
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.
-
-
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
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks