You need to sign in to do that
Don't have an account?
Anumca
Displaying First & Last Dates of a month In VF page
Hi All
I want to display the First & last dates of given month in VF page using Controller
forexample: If we given 14/6/2011 date,then it should be display the first date of the month & end date of the month.
Please help me.
Thanks & Regards
Anu
the first date, for obvious reasons, will be the first
so
integer monthnumber = 6;
Date todaysdate = Date.today();
Date start = Date.newInstance(todaysdate.year(), monthnumber, 1);
For end use daysInMonth method
integer noOfDays = Date.daysInMonth(todaysdate.year(), monthnumber);
Date end = Date.newInstance( todaysdate.year, monthnumber, noOfDays);
you can also use the toStartOfMonth to get the start date, if you are using a date instance
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_date.htm
Hiii
Thanks for the Reply.
If u dont mind can u please send me how to call that start string in VF page.
Please help me
Thanks& Regards
Anu...
Use this