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 08-28-2004, 04:51 PM   #1
BradM
Confirmed User
 
Join Date: Dec 2003
Location: 1123,6536,5231
Posts: 3,397
quick php date() help

You'll see what I am trying to go... hopefully lol


$yesterday = date(("F")+(("d")-1)+("Y"));

I am trying to minus 1 from the d, so I get "yesterday". How can I do this? I am probably making it too difficult. :p
BradM is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 04:55 PM   #2
Arty
Confirmed User
 
Join Date: Nov 2002
Posts: 880
Quote:
Originally posted by BradM
You'll see what I am trying to go... hopefully lol


$yesterday = date(("F")+(("d")-1)+("Y"));

I am trying to minus 1 from the d, so I get "yesterday". How can I do this? I am probably making it too difficult. :p
$yesterday = date("F d Y",mktime(0,0,0,date("F"),date("d")-1,date("Y")));
Arty is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 04:56 PM   #3
Fukeneh
Confirmed User
 
Industry Role:
Join Date: Mar 2004
Location: Location: Location:
Posts: 1,245
isnt there already a flag for yesterday in php?
Fukeneh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 04:57 PM   #4
patch
Registered User
 
Join Date: Jul 2002
Location: Here now, ok?
Posts: 19
$yesterday = date("F d Y", time()-86400);
patch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 04:57 PM   #5
BradM
Confirmed User
 
Join Date: Dec 2003
Location: 1123,6536,5231
Posts: 3,397
Quote:
Originally posted by Arty
$yesterday = date("F d Y",mktime(0,0,0,date("F"),date("d")-1,date("Y")));
I tried that dude, the output I get is: December 27 2003

REALLY weird hey?
BradM is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 04:58 PM   #6
BradM
Confirmed User
 
Join Date: Dec 2003
Location: 1123,6536,5231
Posts: 3,397
Quote:
Originally posted by patch
$yesterday = date("F d Y", time()-86400);
Cheers patch, much appreciated!
BradM is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 04:58 PM   #7
Arty
Confirmed User
 
Join Date: Nov 2002
Posts: 880
Sorry Correction,

$yesterday = date("F d Y",mktime(0,0,0,date("m"),date("d")-1,date("Y")));

Arty is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 05:06 PM   #8
fuzebox
making it rain
 
fuzebox's Avatar
 
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,114
This thread is hilarious

Cheers to patch for an answer that makes sense.
fuzebox is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 05:12 PM   #9
BradM
Confirmed User
 
Join Date: Dec 2003
Location: 1123,6536,5231
Posts: 3,397
Quote:
Originally posted by fuzebox
This thread is hilarious

Cheers to patch for an answer that makes sense.
Fuzebox is a c-unt
BradM is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 05:15 PM   #10
Intrigue
Confirmed User
 
Join Date: Feb 2004
Location: Ohio, US
Posts: 662
hey dude, just use strtotime("-1 day");
Intrigue is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 05:25 PM   #11
patch
Registered User
 
Join Date: Jul 2002
Location: Here now, ok?
Posts: 19
Quote:
Originally posted by Intrigue
hey dude, just use strtotime("-1 day");
My eyes prefer "-86400" to "- 1 day"

And the full line is shorter that way....
patch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 05:33 PM   #12
JSA Matt
So Fucking Banned
 
Join Date: Aug 2003
Location: San Diego, CA
Posts: 5,464
date("F d Y", strtotime("yesterday"));
date("F d Y", strtotime("-1 day"));

should have plenty of ways to do it lol.. I prefer the mktime method
JSA Matt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 05:43 PM   #13
KC
Confirmed User
 
Industry Role:
Join Date: Jan 1995
Posts: 2,417
You guys are crazy.

Yesterday was the 28th.
__________________

Jupiter Hosting, Inc.
Vice President, Business Development
kc (AT) jupiterhosting.com
KC is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 05:48 PM   #14
Arty
Confirmed User
 
Join Date: Nov 2002
Posts: 880
Quote:
Originally posted by patch
My eyes prefer "-86400" to "- 1 day"

And the full line is shorter that way....
It's not only shorter but also faster than other solutions, especially than the strtotime solution
Arty 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.