GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP Date Question?? (https://gfy.com/showthread.php?t=43293)

FADE19 12-02-2001 11:10 AM

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

JackFoley 12-02-2001 12:08 PM

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).]

Theo 12-02-2001 01:00 PM

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);



Theo 12-02-2001 01:02 PM

my script prints the date in the following format:
12 2 2001
wait a min to see how it will go in your case

Theo 12-02-2001 01:04 PM

echo gmDate("M d Y",time() - 432000);

i think that's the case http://bbs.gofuckyourself.net/board/smile.gif

FADE19 12-02-2001 05:02 PM

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