Hi! i'm using JIRA 6.3.9
I have date of birth, and i need JIRA to count his age.
I tryed this formula:
<!-- @@Formula: issue.get("created")==null ? null : ((new Date().getTime()) - issue.get("customfield_xxxxx").getTime()) / 1000 / 31536000 -->
It works close, but not perfect. If i put date of birth 20 december 1974 - it will count 40 years (instead of 39)
That's because the value is rounded up to the nearest integer. If you want to truncate the value instead, use Math.floor( ):
<!-- @@Formula: issue.get("created")==null ? null : Math.floor(((new Date().getTime()) - issue.get("customfield_xxxxx").getTime()) / 1000.0 / 31536000) -->
Yes, you should divide by 31557600 (365,25 days per year).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.