Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

last date of this month

images php coding issues or problems here.

Moderators: macek, egami, gesf

last date of this month

Postby eklijesh » Wed Apr 13, 2011 12:38 am

Last date of this month

echo date("Y-m-d",strtotime("+1 month -1 second"),strtotime(date("Y-m-1")));

Last date of next month

echo date("Y-m-d",strtotime("+2 month -1 second"),strtotime(date("Y-m-1")));

Last date of previous month

echo date("Y-m-d",strtotime("-1 second"),strtotime(date("Y-m-1
eklijesh
New php-forum User
New php-forum User
 
Posts: 1
Joined: Wed Apr 13, 2011 12:26 am

Re: last date of this month

Postby egami » Wed Apr 13, 2011 5:01 am

date('t'); // number of days in a month.

date('t',mktime(0,0,0,date('m')-1,1,date('Y')) // days last month
date('t',mktime(0,0,0,date('m')+1,1,date('Y')) // days of next month
User avatar
egami
php-forum GURU
php-forum GURU
 
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.