Year.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Year.

Post by JellyFish »

How do I get the current year? Like: 2008.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Whoa, jellyfish, how about a decent title?

Research the date function. Have you downloaded a copy of the manual yet?
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

astions wrote:Whoa, jellyfish, how about a decent title?

Research the date function. Have you downloaded a copy of the manual yet?
I just go to the php.net for the manual, should I download it and why? I'm going to do as you say.

PS: Sorry about the title... No excuses.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

JellyFish wrote:I just go to the php.net for the manual, should I download it and why? I'm going to do as you say.
Just to keep it handy.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

On windows, you can use the CHM version, which has nice search capabilities.

http://www.php.net/get/php_manual_en.ch ... his/mirror
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

astions wrote:On windows, you can use the CHM version, which has nice search capabilities.

http://www.php.net/get/php_manual_en.ch ... his/mirror
What's CHM?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Compiled Help Something. You may want to install the google toolbar too. :wink:
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

CHM = Compiled HTML Help File

But your avatar suggests that you are not Windows user :)
There are 10 types of people in this world, those who understand binary and those who don't
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

The last time I got the CHM version, it was like.. halfway empty. Nothing worked. :(
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Excluding people on dial-up and/or limited internet availability: what's not handy about php.net? It's got a fantastic search system and other searchable online documentation.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

One thing I like about the CHM is the view where you can type in the first few characters of a function and it will bring up a list of matches. You can also get integrated user comments, so it's pretty much the same.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Jcart wrote:Excluding people on dial-up and/or limited internet availability: what's not handy about php.net? It's got a fantastic search system and other searchable online documentation.
I've found that the not-so-searchable HTML version that I have brings my attention to the whole rather than just a certain function, as everything is organized into libraries and categories.
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

VladSun wrote:CHM = Compiled HTML Help File

But your avatar suggests that you are not Windows user :)
Really? Look again...
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

... a lot or responses but no questions answered... :roll:

Code: Select all

echo date("Y");
angelena
Forum Commoner
Posts: 53
Joined: Mon Nov 22, 2004 4:10 am

Post by angelena »

Uppercase Y will return year in 4 digit
Lowercase y will return year in 2 digit

Such as example below :

Code: Select all

$today = date("m.d.y");                 Output >>>>    03.10.01
$today = date("j, n, Y");                 Output >>>>   10, 3, 2001
Post Reply