View Full Version : requesting for a prog
user88
12-07-2006, 04:03 PM
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.
djr33
12-07-2006, 10:39 PM
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.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.