Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Oct 04, 2009 at 11:22 AM

    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

    Add comment
    10|10000 characters needed characters exceeded