iNTERFACEWARE Products Manual > Installing and Using Chameleon > Using Python Scripting > Chameleon Python API > Environment Variable > Converting a Date from String to Double |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
In Python, dates are represented as strings in segment-level Python scripts, but are represented in a date time double precision format in table-level Python scripts and the Table Object. To convert a date from a string to a double, use the date_time_to_double() function:
Here, String is the string to be converted, and Format is the format to use when converting. This format is one of the date time formats listed in the Date Time Formats section of the Chameleon Workspace: Here, the available date time formats are DateTime and Date.
The date_time_to_double() function is useful if you want to use a Segment Inbound script to extract a date from a field in an incoming HL7 message and then use a Table Inbound script to load this date into a field of a table. The Segment Inbound script just assigns the date to a global variable:
The Table Inbound script then converts the date to the format used in tables:
|