Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the current day of the year in PHP?

Tags:

php

Is there a standard function in PHP that will find the day number of the year based on the current date?

Examples:

Jan 22nd = 22  Feb 27th = 58 Mar 5th = 64 

If there isn't a standard function, has anyone built anything similar that would handle the conversion? What all is involved?

like image 463
mike Avatar asked Jan 23 '10 02:01

mike


People also ask

How can I get today's day in PHP?

You can simply use the PHP date() function to get the current data and time in various format, for example, date('d-m-y h:i:s') , date('d/m/y H:i:s') , and so on.

What does date () do in PHP?

The date function in PHP is used to format the timestamp into a human desired format. The timestamp is the number of seconds between the current time and 1st January, 1970 00:00:00 GMT. It is also known as the UNIX timestamp.

How can I get current date in dd mm yyyy format in PHP?

php /*print date in dd/mm/yy format*/ print "Current date in dd/mm/yy format: " . date("d/m/y"); print "</br>"; /*print date in dd/mm/yyyy format*/ print "Current date in dd/mm/yyyy format: " . date("d/m/Y"); print "</br>"; /*print date in dd MON yyyy format*/ print "Current date in dd MON yyyy format: " .


1 Answers

date('z') + 1;

like image 92
Mike Avatar answered Oct 15 '22 09:10

Mike