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.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-02-2001, 11:10 AM   #1
FADE19
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
FADE19 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-02-2001, 12:08 PM   #2
JackFoley
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).]
JackFoley is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-02-2001, 01:00 PM   #3
Theo
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);


Theo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-02-2001, 01:02 PM   #4
Theo
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
Theo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-02-2001, 01:04 PM   #5
Theo
HAL 9000
 
Industry Role:
Join Date: May 2001
Posts: 34,515
echo gmDate("M d Y",time() - 432000);

i think that's the case
Theo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-02-2001, 05:02 PM   #6
FADE19
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
FADE19 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.