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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.