date - Android Calendar Count Month -


how can first day @ 00:00 o clock , last day @ 00:00 of last month (currentmonth -1) date. have values in sqlite unix timestamp, there simple way filter values specific month. example current month june , want count how many values have june unix timestamp ( june 2014, june 2013...) without specifying year or day.

i current timestamp this

long timestamp = system.currenttimemillis()/1000; 

simpledateformat dateformat = new simpledateformat("yyyy/mm/dd hh:mm:ss");                 calendar cal = calendar.getinstance();                 cal.add(calendar.month, -1);                    string lastmonth =  dateformat.format(cal.gettime());                toast.maketext(getapplicationcontext(), lastmonth, toast.length_long).show(); 

i found out how last month still don't know how specific month every year.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -