![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Snow's Parole Officer
Join Date: Sep 2001
Location: mud hut next to Bin Laden's
Posts: 1,161
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Jul 2001
Location: Pac-land
Posts: 858
|
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).] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
HAL 9000
Industry Role:
Join Date: May 2001
Posts: 34,515
|
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); |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
HAL 9000
Industry Role:
Join Date: May 2001
Posts: 34,515
|
my script prints the date in the following format:
12 2 2001 wait a min to see how it will go in your case |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
HAL 9000
Industry Role:
Join Date: May 2001
Posts: 34,515
|
echo gmDate("M d Y",time() - 432000);
i think that's the case ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Snow's Parole Officer
Join Date: Sep 2001
Location: mud hut next to Bin Laden's
Posts: 1,161
|
Thanks guys...I got it...LOL, it came to me after I posted the question...isn't that always the case
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |