Tech Tip: Converting MultiValue Dates to Internet Dates

These days we have to interact with other systems, which also means interacting with other dates and times. UTC dates is a common date that we run into, as well as RFC1123 dates, which are commonly found in web data.

UTC (Universal Time Conversion) is a unique format that, while easy to generate and parse, sometimes can cause confusion.

yyyymmddThhmmssZ = 20100301T100000Z

This translates into 03/01/2010 10:00:00 AM GMT (Greenwich Mean Time).

To convert to GMT requires you to provide some additional information about the date and time information on your servers.

RFC1123 is a common format in e-mails, but can also be found in other web data. While it does the same things as UTC, its format is a little more human readable.

 
mmm dd, yyyy hh:mm:ss GMT = Mar 01 2010 10:00:00 GMT

Again, you see the GMT, while you can use other time zones with RFC1123, many times it's easier to just use GMT.

I have supplied a program that will help you convert your internal date/time information into one of these 2 standard date/time formats:

LOCAL.DATE = DATE()
LOCAL.TIME = TIME()
LOCAL.TIMEZONE = "PST"
CALL CONVERT.DATETIME.TO.UTC1(LOCAL.DATE,LOCAL.TIME,LOCAL.TIMEZONE,UTC,RFC1123.DATE,GMT.INFO,"")
CRT "UTC: ": UTC
CRT "RFC1123: ": RFC1123.DATE
CRT "GMT: ": GMT
END

You can get the source for this subroutine at:

www.intl-spectrum.com/resource/134/UTC_RFC1123_Conversion.aspx

TechTip_Figure 1

Fig. 1

Do you have a Tech Tip to share? E-mail it to editor@intl-spectrum.com

Featured:

Mar/Apr 2010

menu
menu