Try OpenEdge Now
skip to main content
ABL Data Types Addenda
DATETIME and DATETIME-TZ data types : Dumping and loading DATETIME and DATETIME-TZ fields
 

Dumping and loading DATETIME and DATETIME-TZ fields

You can use EXPORT and IMPORT to dump and load DATETIME and DATETIME-TZ fields. The dump format is fixed and follows the ISO 8601 standard for datetime representations. For DATETIME, there is no time zone offset.
This example shows orders that were created in different time zones:
/* dump_order.p */

OUTPUT TO dump.txt.

FOR EACH Order:
   EXPORT SalesRep Carrier OrderDate OrderDateTZ.
END.

OUTPUT CLOSE
For example, assume the OrderDate field in the sports2000.Order table is a DATETIME, and there is an additional DATETIME-TZ field, OrderDateTZ that contains the same date and time as OrderDate. Here is the result in dump.txt:
"RDR"  "FlyByNight Courier"  2003-11-01T09:15:55.002   2003-11-01T09:15:55.002-05:00
"HXM"  "Walkers Delivery"    2004-01-04T10:24:44.331   2004-01-04T10:24:44.331+00:00
"HXM" "Standard Mail"        2005-03-28T13:02:29.866   2005-03-28T13:02:29.866+02:00