infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Cloverleaf
Calculate date differences
Charlie Bursell
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
#
Find more posts tagged with
Clovertech
Comments
Charlie Bursell
Got the message: Sorry, you are not allowed to upload this file type/
Try again
Will someone please let us know what types of files can we upload.
dateDiff.txt