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
GMT Time Conversion
System
Originally posted by Robbie Parker
Any 'simple' ideas on how to convert GMT time to local time?
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
Robbie,
First let me say I have never done this - never had the need - so I don't have any 'tricks'.
You are in the US Eastern Time Zone. If I recall correctly that is +8 hours relative to GMT (you can check this on the Web).
Hopefully your source time is in 24 hour (sometimes called 'military') time format. If it is not, you probably will want to convert it.
Then add 8 hours (or whatever you discover your offset is) to the hours portion of the GMT time you are given. If your result exceeds 24, subtract 24 from the hours - and if you also need to handle date, increment your date by one day (remember to adjust if flowing over a month or year).
Jim Kosloskey
Rob Abbott
Use the Tcl 'clock' command for any date/time math.
clock scan - convert time/date formats into epoch seconds
Do any math on the epoch (e.g. subtract (60 * 60 * 5) from the epoch in GMT)
clock format - convert epoch seconds back into time/date formats
tclhelp or 'help clock' will give you all the details.
Jim - I think EST is GMT-5
Charlie Bursell
Even simplier. The clock command is your friend
You must have a date/time string that is scanable. The clock scan command expects the date/time to be a list where the date is the first element and the time, if present, is the second element.
Given a GMT date/time in the format:
set datetime 20070626100505
An easy way to make it scanable is with regsub. This command will put a space between date and time, if there, else it will leave it as is if no time.
regsub -- {(d{8})(d*)} $datetime {1 2} datetime
Then simply use the clock command to format to local time. Your OS time zone environment will be used for the difference between local and GMT
set local [clock format [clock scan $time -gmt 1]
-format %Y%m%d%H%M%S]
Assume you are on Central Time
echo $local
=> 20070626050505