ltdt = 'Thu, 20 May 2004 08:50:03 PDT' ltdt = ALLTRIM(SUBSTR(ltdt, AT(',', ltdt) + 1))Next, I'd insert the month number, which I'd get from a look-up table
LOCATE FOR LEFT(lddt, 3) = monthname ltdt = STUFF(ltdt, 4, 3, monthnum)Then I'd replace the spaces with a slash.
ltdt = STUFF(ltdt, AT(SPACE(1), ltdt), 1, '/') ltdt = STUFF(ltdt, AT(SPACE(1), ltdt), 1, '/')Next, I set the date format.
lcdateformat = SET('DATE') SET DATE TO DMYThen translate it to a date/time
lcdt = ltdt ltdt = CTOT(LEFT(ltdt, LEN(ltdt) - 4)) SET DATE (lcdateformat)Finally, I'd use a lookup table with the last 3 characters of the string. The table would have a structure containing the 3 characters of the timezone (for example: PST, PDT, EST, EDT, etc.) and the bias between it and your timezone. It would probably be a good idea to express this in seconds so that you could simply add it to the date/time you've got. If the bias is negative, adding it would produce the correct result.
LOCATE FOR RIGHT(lcdt, 3) = timezone.timezone ltdt = ltdt + timezone.bias