«

»

Sep 14 2009

Convert UTC Time Format to Local Date and Time format

VN:F [1.9.22_1171]
Rating: 3.4/5 (5 votes cast)

The field JSSCHSTTIME in F91320 stores the Scheduled Start Time in UTC format e.g. value 18698955. This is a Local Date and Time format of 2005-07-21  17:15:00

JSSCHSTTIME stores the UTC time. UTC stands for Universal Time Coordinate and is a long integer containing the elapsed minutes since Midnight on January 1, 1970 in Greenwich, England.

Now lets write some code which would help converting timezones, from and to. Similarly use UTC time zone and its format effectively for Multi-Location Projects/softwares. But before hand make sure daylight saving rules (DST) are set up correctly in P00085 application. This is applicable only for countries observing DST. The Event rules (ER) along with the screen shot of the app done is given below.

UTCTimeApp

Listing of ER for Application : Test for UTC Timezones (P550003)
==================================
FORM: Fix/Inspect [FIX INSPECT] (W550003A)
==================================
CONTROL: FORM
EVENT: Post Dialog is Initialized
-----------------------------------------
// Retrieve the Current UTC Time into a Long Integer Variable
Get Current UTC Time
     VA frm_SchStartTime_SCHTTIME <- BF mnCurrentUTCTime
// Display UTC Time
FC UTCTime_UTIME = utc_get_cur_time()

-----------------------------------------------------------------------
CONTROL: BUTTON Convert EVENT: Button Clicked
-----------------------------------------------------------------------
// Get the Local Time from UTC TimeZone
Get Time and Date From UTC
     VA frm_SchStartTime_SCHTTIME -> BF mnUTCTime
     FC Time Last Updated <- BF mnTime
     FC Date Updated <- BF jdDate
     "2" -> BF cUTC_Local
     "14" -> BF szTimeZone
//
//
// Format the Time into hh:mm:ss
Format MathNumeric to Time String
     FC Time Last Updated -> BF mnTime
     FC FormattedTime <- BF szTime
     "Zero"-> BF cFormatMode

Call Business Function “Get Time and Date From UTC” – B9800009
This function can be used to return the date and time for a UTC time in Local Date and Time format.

Get Time and Date From UTC
“18698955” -> mnUTCTime
VA frm_SchedulerStartTime_SCHSTTIME <- mnTime
FC Scheduled Start Date <- jdDate
“2” -> cUTC_Local            /* 2 stands for Local Time.   1 stands for UTC time  */
“14” -> szTimeZone          /* Check UDC H91/TZ for your country time zone. “14” is Indian Standard Time Zone */


Help From: Customer Connection Solution 200999495

Published under the license.

VN:F [1.9.22_1171]
Rating: 3.4/5 (5 votes cast)
Convert UTC Time Format to Local Date and Time format, 3.4 out of 5 based on 5 ratings
(Visited 1,553 times, 5 visits today)

About the author

Deepesh M Divakaran

Deepesh MD is more of a Gizmo Geek, and a techie.
A very experienced Technical Consultant on Oracle JD Edwards EnterpriseOne, and OneWorld. As a consultant he has worked for wide range of industries, from Manufacturing, Media, Oil & gas etc. and has worked on re-engineering modules, and areas of customization.
With a touch of class and understanding towards what ever he does, he is often regarded by his colleagues as the one stop answer for all Technical/Software related queries.

2 comments

  1. Mahesh

    That was really helpful. Thanks for the BSFN usage.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  2. Sharon Scronce

    I need to convert US date/time into Mexico City date/time in JDE E1. I found BF B90CG010 (ConvertUTCtoUserDateandTime) but I’m not sure what variables I need to pass or where to get them. Is there an easier way to do this? Thanks. Sharon Scronce

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

Leave a Reply