Skip to main content
Omnitracs Knowledge Base

Convert GMT Secs to Date Time in a Given Time Zone - OMGMT2DZ

Convert GMT Secs to Date/Time in a Given Time Zone (OMGMT2DZ)

Required Parameter Group:

1

GMT Seconds

Input

Packed(13,0)

2

Convert to Time Zone

Input

Char(3)

3

Obey Daylight Savings

Input

Char(1)

4

Date/Time Format

Input

Char(4)

5

Include Separators

Input

Char(1)

6

Date/Time Length Type

Input

Char(1)

7

Date/Time String

Output

Char(50)

8

Return Status

Output

Char(1)

API Overview:
The Convert GMT Seconds to Date/Time in a Given Time Zone API (OMGMT2DZ) allows you to convert GMT seconds to a date/time string in a specific time zone. Note that this differs from OMGMT2DT in that the time zone code and obey-daylight-savings flag are input into this API. The OMGMT2DT API converts to the date/time using either the system or user's time zone. Alternately, this API converts to the date/time using the input time zone and obey-daylight-savings flag.

Required Parameter Group Details:
(1) GMT Seconds
INPUT; PACKED(13,0)
This parameter must contain a valid date/time expressed in the number of whole seconds since January 1, 1988 in GMT time zone.

(2) Convert to Time Zone
INPUT; CHAR(3)
This parameter indicates what time zone code should be used to convert the GMT seconds. Valid time zone codes are range between 000-047. Valid values are:

000

GMT-12.0

012

Central

024

GMT

036

GMT+6.0

001

GMT-11.5

013

GMT-5.5

025

GMT+0.5

037

GMT+6.5

002

GMT-11.0

014

Eastern

026

European

038

GMT+7.0

003

GMT-10.5

015

GMT-4.5

027

GMT+1.5

039

GMT+7.5

004

Hawaii

016

Atlantic

028

Euro-Asian

040

GMT+8.0

005

GMT-9.5

017

Newfoundland

029

GMT+2.5

041

GMT+8.5

006

Alaska

018

Brasilia

030

Moscow

042

Japanese

007

GMT-8.5

019

GMT-2.5

031

GMT+3.5

043

GMT+9.5

008

Pacific

020

Mid-Atlantic

032

GMT+4.0

044

GMT+10.0

009

GMT-7.5

021

GMT-1.5

033

GMT+4.5

045

GMT+10.5

010

Mountain

022

GMT-1.0

034

GMT+5.0

046

GMT+11.0

011

GMT-6.5

023

GMT-0.5

035

GMT+5.5

047

GMT+11.5

(3) Obey Daylight Savings

This parameter indicates if the Date/Time String should obey the daylight savings time rules. Valid values are:

  • Y - Yes
  • N - No

(4) Date/Time Format

This parameter contains the requested output format for the Date/Time String. Valid values are:

  • *MDY - Month, day, year format (MM/DD/YY)
  • *DMY - Day, month, year format (DD/MM/YY)
  • *YMD - Year, month, day format (YY/MM/DD)
  • *JUL - Julian format (YY/JJJ)
  • *JOB - Evaluates to one of the above

(5) Include Separators

This parameter indicates if the Date/Time String should include separators. Valid values are:

  • 0 - Do not include separators
  • 1 - Include separators

(6) Date/Time Length Type

This parameter indicates the length type for the Date/Time String. If this parameter is '0' or '1', then the time zone abbreviation is returned right-justified in positions 19-22 of the Date/Time String. If this parameter is '2', then the time zone abbreviation is returned right-justified in positions 21-24 of the Date/Time String. Valid values are:

  • 0 - Long (includes year, month, day, hours, minutes, seconds, & time zone)
  • 1 - Short (includes month, day, hours, minutes, & time zone)
  • 2 - Extra long (includes century, year, month, day, hours, minutes, seconds, & time zone)

(7) Date/Time String

This parameter returns the left-justified converted date string in the format specified by the input parameters.

(8) Return Status

Status value returned to the caller will be set as follows:

  • 0 - Success, date returned
  • 1 - Failure, error encountered

See tables on next page for more information.

Return Formats

Format Separator Length Format of Returned Date/Time & Zone (OUTDAT)
*YMD 0 (no) 1 (short) MMDDHHMM ZZZZ
*MDY 0 (no) 1 (short) MMDDHHMM ZZZZ
*DMY 0 (no) 1 (short) DDMMHHMM ZZZZ
*JUL 0 (no) 1 (short) YYJJJ HHMMSS ZZZZ
*YMD 1 (yes) 1 (short) MM/DD HH:MM ZZZZ
*MDY 1 (yes) 1 (short) MM/DD HH:MM ZZZZ
*DMY 1 (yes) 1 (short) DD/MM HH:MM ZZZZ
*JUL 1 (yes) 1 (short) YY/JJJ HH:MM:SS ZZZZ
*YMD 0 (no) 0 (long) CYYMMDDHHMMSS ZZZZ
*MDY 0 (no) 0 (long) CMMDDYYHHMMSS ZZZZ
*DMY 0 (no) 0 (long) CDDMMYYHHMMSS ZZZZ
*JUL 0 (no) 0 (long) YYJJJ HHMMSS ZZZZ
*YMD 1 (yes) 0 (long) YY/MM/DD HH:MM:SS ZZZZ
*MDY 1 (yes) 0 (long) MM/DD/YY HH:MM:SS ZZZZ
*DMY 1 (yes) 0 (long) DD/MM/YY HH:MM:SS ZZZZ
*JUL 1 (yes) 0 (long) YY/JJJ HH:MM:SS ZZZZ
*YMD 0 (no) 2 (extra long) CCYYMMDDHHMMSS ZZZZ
*MDY 0 (no) 2 (extra long) MMDDCCYYHHMMSS ZZZZ
*DMY 0 (no) 2 (extra long) DDMMCCYYHHMMSS ZZZZ
*JUL 0 (no) 2 (extra long) CCYYJJJ HHMMSS ZZZZ
*YMD 1 (yes) 2 (extra long) CCYY/MM/DD HH:MM:SS ZZZZ
*MDY 1 (yes) 2 (extra long) MM/DD/CCYY HH:MM:SS ZZZZ
*DMY 1 (yes) 2 (extra long) DD/MM/CCYY HH:MM:SS ZZZZ
*JUL 1 (yes) 2 (extra long) CCYY/JJJ HH:MM:SS ZZZZ

Valid Input GMT Seconds

Time Zone Low End Valid GMT Seconds (All of which evaluate to 01/01/1988 at 00:00:00.) High End Valid GMT Seconds (All of which evaluate to 12/31/2039 at 23:59:59.)
Greenwich 0000000000000 0001640995199
Eastern 0000000018000 0001641013199
Central 0000000021600 0001641016799
Mountain 0000000025200 0001641020399
Pacific 0000000028800 0001641023999
  • Was this article helpful?