Several have ask for a means to calculate date differences such as DOB in Years, months and days. I have enclosed a proc to do that. You can source this proc in a another proc or in Xlate like “source $::HciSiteDir/scripts/dateDiff (Assumes stored in scripts directory. Or you add it to a package and simply “package require” FWIW, I have always had a package called myLib where I kept my own little functions.
From the proc comments:
# Name: dateDiff
# Args: startDate (Could be DOB) required
# endDate (Optional) Defaults to today’s date. Must be greater than startDate
#
# Returns: Elapsed YEARS, MONTHS and DAYS as a list
#
# Usage examples:
# lassign [dateDiff 20230115} yrs mos dys
# set variables to elapsed Years, Months, Days since 20230115
#
# lassign [dateDiff 20230115} yrs mos dys
# set variables to elapsed Years, Months, Days since 20230115
# to today’s date
#
# lassign [dateDiff 20230115 20230416} yrs mos dys
# set variables to elapsed Years, Months, Days between 20230115
# and 20230115
#