Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Paano makuha ang year range

bloomer

Recruit
Basic Member
Messages
11
Reaction score
0
Points
16
Magandang umaga po, ahm gusto ko lang po sana humingi ng idea kung papano magdisplay ng year? example(2016-2017);
may ginawa akong code kaso single year lang ang na display ko, di ko alam kung papano gawin na maging 2016-2017 bali kukunin yung past 1 year.
 
select * from table where date >= datetimepicker1.text And date <= datetimepicker2.text

kaw bahala mag remedyo....
 
kuya di mo man lang nilagay kung anong PL ang gamit mo... so hulaan portion?
 
Para makuha mo yung previous year

Code:
<?php
//dispay the previous year 
echo date("Y",strtotime("-1 year"));
?>
 
Code:
<?php
	$currentYear = date('Y'); //get current year, ito yung magiging basehan mo ng past year
	$pastYear = date('Y', strtotime('-1 year', strtotime($currentYear))); // kukunin nya yung current year mo, mag-minus sya ng 1 year, then return yung year
	$range = $pastYear . '-' . $currentYear;
?>
 
Back
Top Bottom