Expand my Community achievements bar.

add one year to date/time and see if leap year

Avatar

Level 5

Hi All.

In my form I have date/time field DATE with format MM/DD/YYYY. Add I would like when user selected according date in that field, the other field should display date on one year late then user selected in field DATE. I mean. If user install 8/27/2010 on DATE field in other field will display date 8/27/2011. Also for is important to display correct date if we have LEAP year.

Thanks.

3 Replies

Avatar

Former Community Member

Yes I sent you a sample  that does that .....in your case you can set the Date format in the fields to the way you want but you will have to adjust the code to indicate which format is being passed in. If you look at the code you will see where the format is being passed.

Paul

Avatar

Level 5

Thanks for replay,

I format is done. What about LEAP year?

Thanks.

Avatar

Former Community Member

The code that converts the date into a number of milliseconds from the epoch takes care of that for you.

Paul