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
Read Only Archives
Cloverleaf
Cloverleaf
date conversion issues with last day of year.
Jennifer Johnson (Clovertech)
Has anyone written any tcl that converts and calculates a new date accounting for end of year be it a leap year or otherwise?
I am taking a date, converting it to a julian date, adding a specified amount of days then converting it back. It works fine except for end of year and I'm not sure how to tackle that one.
Correction. I can make this work during a normal year with 365 days but am not sure how to calculate the leap year with 366 days.
Find more posts tagged with
Clovertech
Comments
Charlie Bursell
You are making something hard that should be easier. Read up on the Tcl clock command. It will do that for you plus take care of leap years, etc.
For example:
set dt [clock format [clock scan "10:34:30 PM 3 days"]
System
Originally posted by gricelda lopez
I found another way to add the days. Instead of using the julian date I am just adding days to my IF statement. So far it works, it will need to test it out a little more using different dates but it works so far.
if [string equal $juliant_day "Fri"] {
set dt [clock format [clock scan "3 days"] -format %y%m%d]
echo jult date= $dt
} elseif [string equal $juliant_day "Sat"] {
set dt [clock format [clock scan "2 days"] -format %y%m%d]
echo jult date= $dt
} else {
set dt [clock format [clock scan "1 days"] -format %y%m%d]
echo jult date= $dt
}
System
Originally posted by gricelda lopez
Sorry Jennifer, I posted my resolution to your post instead of mine! ah!