![]() |
PHP Date Question??
Alright I was wondering if any of ya folks had a script lying around that would tell me "when the next friday is:"
Mon = Jan 1, 2001 the code would print out Jan 5, 2001 if the day was Jan Sun 10, 2001 it would look ahead to the next friday. Jan 15, 2001 or if it was friday it just prints the current friday's date.. any info would be greatly appreciated...thanks |
I use this on one of my sites for weekly updates. It might not be the most efficient way, but it works.
<?php $day = date("d"); $month = date("m"); $year = date("Y"); $next = date("F jS, Y", mktime(0,0,0,$month,$day+5-date("w",mktime(0,0,0,$month,$day,$year)),$year)); echo("Next set will be added $next."); ?> Ack. Make sure the $next line doesn't wrap (it should all be on one line). ------------------ SlutBunnies - $30/sale, bitch. [This message has been edited by JackFoley (edited 12-02-2001).] |
echo gmDate("m j Y");
this will print today echo gmDate("m j Y",time() - 86400); this wil print yesterday multiply 86400 x the no of days you want, In your case is 5. So you'll put echo gmDate("m j Y",time() - 432000); |
my script prints the date in the following format:
12 2 2001 wait a min to see how it will go in your case |
echo gmDate("M d Y",time() - 432000);
i think that's the case http://bbs.gofuckyourself.net/board/smile.gif |
Thanks guys...I got it...LOL, it came to me after I posted the question...isn't that always the case http://bbs.gofuckyourself.net/board/smile.gif
|
All times are GMT -7. The time now is 01:06 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123