Hey frndz i m new member of community..!!
.
.
i jst want to knw is there anyway to get the previous month starting and ending date and which is the previoes month..!!!!
.
.
.
.
hope for positive reply..!!
nish123
0
Junior Poster in Training
Recommended Answers
Jump to Posti am giving an idea
$current_month=date('m'); $current_year=date('Y');
apply if condition that if current month is greater than one and less and equal to 12 then
$lastmonth=$current_month-1;
offcource the first date will be 1st and you can take end date as
$firstdate= …
Jump to Postwhat to confused..
you can write..
if($current_month==1) { $lastmonth=12; } else { $lastmonth=$current_month-1; }
Jump to Postor one more simple solution to get last month
$lastmonth = mktime(0, 0, 0, date("m")-1, date("d"), date("Y"));
Jump to Postor one more simple solution to get last month
$lastmonth = mktime(0, 0, 0, date("m")-1, date("d"), date("Y"));
All 15 Replies
BzzBee
5
Posting Whiz
nish123
0
Junior Poster in Training
Shanti C
106
Posting Virtuoso
BzzBee
5
Posting Whiz
BzzBee
5
Posting Whiz
nish123
0
Junior Poster in Training
nish123
0
Junior Poster in Training
Shanti C
106
Posting Virtuoso
minnujp
0
Newbie Poster
tomdchi
0
Newbie Poster
no_matter
0
Newbie Poster
websourceblog
0
Newbie Poster
clandestine8
0
Newbie Poster
diafol
Webiswide
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.