topic Re: How to calculate the age between 2 dates in PTC Mathcad
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320995#M125352
<HTML><HEAD></HEAD><BODY><P>Thanks Richard, I had this in my MC 15 sheet. But Prime does not support the VB Script component - so I think at thsi time there is no way to run it in Prime 3.0</P><P>Best regards</P><P>Walter</P></BODY></HTML>Tue, 26 Nov 2013 13:30:34 GMTWalterSchrabmai2013-11-26T13:30:34ZHow to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320991#M125348
Is there any way in Prime 3.0 to calculate the age in years based from 2 dates?As there are no components (in MC 15 it was possible) in Prime 3.0.I would need it in a programm routine.Is it possible with excel component?thanksWalterThu, 03 May 2018 16:41:25 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320991#M125348WalterSchrabmai2018-05-03T16:41:25ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320992#M125349
<HTML><HEAD></HEAD><BODY><P>Hi walter, </P><P></P><P> See attached, hope it helps</P><P>regards</P><P> Andy</P></BODY></HTML>Tue, 26 Nov 2013 11:27:08 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320992#M125349AndyWesterman2013-11-26T11:27:08ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320993#M125350
<HTML><HEAD></HEAD><BODY><P>Andy,</P><P>thanks, but how can I use this in a Programm routine?</P><P>see attachment and gif pic.</P><P>thanks</P><P>Walter</P></BODY></HTML>Tue, 26 Nov 2013 11:40:38 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320993#M125350WalterSchrabmai2013-11-26T11:40:38ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320994#M125351
<HTML><HEAD></HEAD><BODY><P>The worksheet here: <A href="https://community.ptc.com/docs/DOC-1395">Date Calendar and Time functions.mcd</A> contains a set of functions that are not based on components. I haven't tried coverting them to Prime though.</P></BODY></HTML>Tue, 26 Nov 2013 13:01:29 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320994#M125351RichardJ2013-11-26T13:01:29ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320995#M125352
<HTML><HEAD></HEAD><BODY><P>Thanks Richard, I had this in my MC 15 sheet. But Prime does not support the VB Script component - so I think at thsi time there is no way to run it in Prime 3.0</P><P>Best regards</P><P>Walter</P></BODY></HTML>Tue, 26 Nov 2013 13:30:34 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320995#M125352WalterSchrabmai2013-11-26T13:30:34ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320996#M125353
<HTML><HEAD></HEAD><BODY><P>Convert to Julian, subtract, then convert back?</P></BODY></HTML>Tue, 26 Nov 2013 13:57:30 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320996#M125353buckeyeman2013-11-26T13:57:30ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320997#M125354
<HTML><HEAD></HEAD><BODY><P>You may use the function DayNumber() from Richards worksheet. It does not rely on scripted components and should work for Prime, too.</P></BODY></HTML>Tue, 26 Nov 2013 14:06:29 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320997#M125354Werner_E2013-11-26T14:06:29ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320998#M125355
<HTML><HEAD></HEAD><BODY><P>If you need to write it into a program then you may need to write several components to do it.</P><P>First (as attached) you can convert the string date, assuming a standard format, to day month & year in numeric format.</P><P>Second will do the 'subtraction' but it will need additional statements to tidy up over & underflows on days & months and what happens if the years difference is negative.</P><P>Might not be an issue for your specific instance but could be a useful addition to a function library.</P><P></P><P>Regards</P><P> Andy</P></BODY></HTML>Tue, 26 Nov 2013 14:12:29 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320998#M125355AndyWesterman2013-11-26T14:12:29ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320999#M125356
<HTML><HEAD></HEAD><BODY><P>fe. BirthDate=1/1/1990</P><P> Date2=1/1/2013</P><P></P><P>age= Date2 - BirthDate = 23.0 years</P><P></P><P>HOw convert to Julian?</P></BODY></HTML>Tue, 26 Nov 2013 14:14:41 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/320999#M125356WalterSchrabmai2013-11-26T14:14:41ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321000#M125357
<HTML><HEAD></HEAD><BODY><P>There are functions at the end of the worksheet that do not use scripted components</P></BODY></HTML>Tue, 26 Nov 2013 14:32:35 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321000#M125357RichardJ2013-11-26T14:32:35ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321001#M125358
<HTML><HEAD></HEAD><BODY><P><A class="loading" href="https://en.wikipedia.org/wiki/Julian_day#Converting_Julian_or_Gregorian_calendar_date_to_Julian_Day_Number" title="https://en.wikipedia.org/wiki/Julian_day#Converting_Julian_or_Gregorian_calendar_date_to_Julian_Day_Number">https://en.wikipedia.org/wiki/Julian_day#Converting_Julian_or_Gregorian_calendar_date_to_Julian_Day_Number</A></P></BODY></HTML>Tue, 26 Nov 2013 14:48:26 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321001#M125358buckeyeman2013-11-26T14:48:26ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321002#M125359
<HTML><HEAD></HEAD><BODY><P>Thanks Andy, I could make it!</P></BODY></HTML>Tue, 26 Nov 2013 15:32:12 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321002#M125359WalterSchrabmai2013-11-26T15:32:12ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321003#M125360
<HTML><HEAD></HEAD><BODY><P>Thanks, littel complicated but ready to enrich my knowledge.</P><P>walter</P></BODY></HTML>Tue, 26 Nov 2013 15:34:03 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321003#M125360WalterSchrabmai2013-11-26T15:34:03ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321004#M125361
<HTML><HEAD></HEAD><BODY><P>Hi Walter,</P><P></P><P> Added a few more lines to the programs - hope it helps</P><P></P><P>Regards</P><P>Andy</P></BODY></HTML>Tue, 26 Nov 2013 16:01:50 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321004#M125361AndyWesterman2013-11-26T16:01:50ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321005#M125362
<HTML><HEAD></HEAD><BODY><P>We can do it by Excel help too</P></BODY></HTML>Tue, 26 Nov 2013 16:59:38 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321005#M125362ValeryOchkov2013-11-26T16:59:38ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321006#M125363
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD><P>Valery Ochkov wrote:</P><P></P><P>We can do it by Excel help too</P></TD></TR></TBODY></TABLE></BLOCKQUOTE><P>Andy already showed the use of an Excel component in the very first answer.</P><P>But Walter is in need of a function which can be called from a program.</P><P>How would you turn an Excel component into a function?</P></BODY></HTML>Tue, 26 Nov 2013 17:02:18 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321006#M125363Werner_E2013-11-26T17:02:18ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321007#M125364
<HTML><HEAD></HEAD><BODY><P>It would be nice to have something like this attached MC15 sheet that accounts for leap years in Prime 3.</P><P></P><P>Norm</P></BODY></HTML>Tue, 26 Nov 2013 18:24:15 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321007#M125364nas0k2013-11-26T18:24:15ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321008#M125365
<HTML><HEAD></HEAD><BODY><P>The leap year handling in this sheet is done outside the scripted component so you can use it as well in Prime.</P><P>The only routine which won't work in Prime is SplitDate().</P><P>Given that date usually is not given as "15 May 1980" but rather as "15.5.1980" (or "5-15-1980" in other countries) it should be not that difficult to write a Prime only routine to split.</P><P>The drawback is of course that without VBScript we have no access to the default date format of the underlying OS.</P></BODY></HTML>Tue, 26 Nov 2013 18:47:11 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321008#M125365Werner_E2013-11-26T18:47:11ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321009#M125366
<HTML><HEAD></HEAD><BODY><P>Yes, it sheems to be perfect now! Thanks</P></BODY></HTML>Tue, 26 Nov 2013 19:14:15 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321009#M125366WalterSchrabmai2013-11-26T19:14:15ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321010#M125367
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD><P>Werner Exinger wrote:</P><P></P><BLOCKQUOTE class="jive-quote"><P>Valery Ochkov wrote:</P><P></P><P>We can do it by Excel help too</P></BLOCKQUOTE><P>Andy already showed the use of an Excel component in the very first answer.</P><P></P></TD></TR></TBODY></TABLE></BLOCKQUOTE><P>Sorry, but I did not seen any picture:</P><P><IMG __jive_id="61984" alt="day.png" class="jive-image" src="https://community.ptc.com/legacyfs/online/61984_day.png" /></P></BODY></HTML>Tue, 26 Nov 2013 22:16:00 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321010#M125367ValeryOchkov2013-11-26T22:16:00ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321011#M125368
<HTML><HEAD></HEAD><BODY><P>Walter needs a function and unfortunately it seems we cannot turn the Excel component into a function (like: DeltaD(d1,d2):=...) as we can do with a solve block.</P></BODY></HTML>Wed, 27 Nov 2013 00:02:58 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321011#M125368Werner_E2013-11-27T00:02:58ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321012#M125369
<HTML><HEAD></HEAD><BODY><P>My attempt in P3 (attached) that matches the MC15 results. </P><P></P><P>I hope this helps.</P></BODY></HTML>Wed, 27 Nov 2013 03:02:35 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321012#M125369nas0k2013-11-27T03:02:35ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321013#M125370
<HTML><HEAD></HEAD><BODY><P>Thank you very much, Norm. Now I can also calculate the years behind the comma.</P></BODY></HTML>Wed, 27 Nov 2013 08:22:14 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321013#M125370WalterSchrabmai2013-11-27T08:22:14ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321014#M125371
<HTML><HEAD></HEAD><BODY><P>How displayed in the plot two points with dates, such as "01/04/1767" and "05/05/1768"? That is not just displayed the year ("1767", "1768"), but also to consider number of days (just a sum them to a year?).</P><P></P><P><IMG __jive_id="62075" class="jive-image-thumbnail jive-image" onclick="" alt="Pic_1.png" src="https://community.ptc.com/legacyfs/online/62075_Pic_1.png" width="450" /></P></BODY></HTML>Thu, 28 Nov 2013 07:34:57 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321014#M125371VladimirN.2013-11-28T07:34:57ZRe: How to calculate the age between 2 dates
https://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321015#M125372
<HTML><HEAD></HEAD><BODY><P>What about the addition of the fractionofyear to 1767?</P><P>see the routine in Norm`s sheet.</P></BODY></HTML>Thu, 28 Nov 2013 10:36:54 GMThttps://community.ptc.com/t5/PTC-Mathcad/How-to-calculate-the-age-between-2-dates/m-p/321015#M125372WalterSchrabmai2013-11-28T10:36:54Z