How to calculate a leap year - InfoPath Dev
in

InfoPath Dev

How to calculate a leap year

Last post 04-18-2008 07:11 AM by Clay Fox. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-17-2008 07:47 AM

    How to calculate a leap year

    I am trying to add 5 years onto a simple date that is picked by the user, but using the adddays *365 doesnt take into account leap years.

    Pleae could someone be kind enough to tell me what the calculation is

    Thank you very much in advance.

     

    Edward

  • 04-17-2008 09:21 AM In reply to

    Re: How to calculate a leap year

    Welcome to the forum Edward.

    You need to use the DateDiff vbscript.

    Search on DateDiff here and you can find some samples.

  • 04-17-2008 09:38 AM In reply to

    Re: How to calculate a leap year

    Thank you very much for your very quick response, I am trying but still cant do it.

    All i m trying to do is take a year, say 5 and add exactly 2 years to it and return the new date taking into account leap years etc.

    I have been at it for hours and just ant wok it out.

    Kind Regards

    Edward

  • 04-18-2008 05:30 AM In reply to

    Re: How to calculate a leap year

    Thank you very much for your very quick response, I am trying but still cant do it.

    All i m trying to do is take a years value, say 5 and add exactly 2 years to it and return the new date taking into account leap years etc.

    I have been at it for hours and just cant work it out. Would you be able to help me?

    Kind Regards

    Edward

  • 04-18-2008 07:11 AM In reply to

    Re: How to calculate a leap year

    Still not sure what you want.

    so you want to add 5 years to 4/18/2008 and get 4/18/2013?  Even though that is not 365x5 days?

    If it is that simple you can use substrings and concatenate to create your date. Seperate the year, add the amount, and then concatenate it back together again.

     

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.