コミュニティ

Difference between two dates as an integer

Hi,

I have two date fields and I want to get the difference of these dates as an integer and have it in another field.
I am using FlexiLayout studio for the document definition.
Please let me know how to achieve this?

Thanks!

この記事は役に立ちましたか?

0人中0人がこの記事が役に立ったと言っています

コメント

2件のコメント

  • Avatar
    Anastasiya Nechaeva

    The following code snippet (JScript) allows to calculate date difference and write it to the Interval field. Please note the date format is mm/dd/yyyy.


    today = new Date("10/15/2015");
    olddate = new Date("10/10/2015");
    diff = today.getTime() - olddate.getTime();
    diffs = Math.floor(diff / 1000 / 60 / 60 / 24); // get days
    this.Field("Interval").Text = diffs;​


    Here you can find more examples with date processing.
    0
  • Avatar
    Permanently deleted user
    Thank you!
    0

サインインしてコメントを残してください。