Home > Date Time, PHP > Get First day of input dates and last day of input date

Get First day of input dates and last day of input date

$mydate = ‘2011-02-04’;

//Get First Day date from given date
echo date(“Y-m-1”, strtotime($mydate) ) ;

//Get Last Day date from given date
echo date(“Y-m-t”, strtotime($mydate) ) ;

Advertisements
Categories: Date Time, PHP Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: