cancel
Showing results for 
Search instead for 
Did you mean: 

Very easy question - How to find out the first date of year

Former Member
0 Kudos

Hi Experts,

I have created Web Dynpro program. I have to set one field "start_date" as first date of year. For example if current date is 04/10/2009, then program should set value of field "start_date" as 01/01/2009.

If suppose program is used on 12/12/2012, then program should set the value of "start_date" as 01/01/2012.

Please peovide me some code.

Regards,

Gary

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

This line should give you the current year.

Calendar.getInstance().get(Calendar.YEAR);

Prefix 01/01/ to this will give you the first day of that year.

Thanks,

Venkat

Answers (0)