intermodal
Intermodal moves a container between ship, rail and truck. Each hand-off has its own clock, its own tariff and its own paperwork. This layer covers the free time a container gets and the charges after it, the dates on billing deadlines and bills of lading, an ETA across several modes, and the timestamps inside EDI messages and EPCIS events.
What these functions solve
Section titled “What these functions solve”- Free time ends on a different day depending on how it is counted. Which day counts as day one, which zone the days are counted in, and which event starts the clock all change the answer.
freeTimeExpiry,chargeableDaysanddemurrageClocktake each of those as a term you state, and count local days at the terminal. See guide, Free Time Ledger, mistakes. - An invoice, a dispute and a resolution each have a last date. Counting from the wrong date, or with a window fixed in code, moves all three.
billingTimelinelays out the chain from the date you name and the windows you pass. See guide, Billing Deadlines. - Some EDI timestamps state their offset and some do not. Reading one that states none as UTC moves the event.
classifyEdifactDtmFormattells which kind a code is.parseEdifactDateTimeandparseEdifactOffsetDateTimeread each kind as what it states, andx12TimeCodeZonereads a zone name such as ET without turning it into an offset. See guide, DTM Decoder, X12 Time Reader. - An event time kept without its offset can never show its local time again.
parseEpcisEventandformatEpcisEventkeep the instant and the offset together.bolTimestampdates a bill of lading on the local clock where the event took place. See guide, scenario. - An ETA that adds up only the travel times leaves out the wait for the next sailing.
multimodalETAchains the legs, and reports the time in transit and the time in dwell separately. See guide, scenario.
Start with the guide: Intermodal: Free Time and Demurrage.
billingTimeline: Lay out the deadline chain around a demurrage or detention invoice: the last date it may be issued, the last date it may be disputed, and the last date the dispute must be resolved.chargeableDays: Count the days a container is charged for between the start of its clock and its exit, and list the dates behind the count.demurrageClock: Pick the two events a charge’s clock runs between.freeTimeExpiry: Lay out a container’s free time from the instant its clock started, and say when it ends.multimodalETA: Compute an end-to-end ETA across the legs of a multimodal move, and report the time in transit and the time in dwell separately.
bolTimestamp: Render an instant as the date a bill of lading carries for an event: the calendar date on the local clock where the event happened.formatEdifactDate: Write an ISO 8601 date as a UN/EDIFACTDTMvalue (data element 2380) in a date format code (data element 2379).formatEdifactDatePeriod: Write two ISO 8601 dates as a UN/EDIFACTDTMperiod (data element 2380) in a date period format code (data element 2379).formatEdifactDateTime: Write an ISO 8601 local date-time as a UN/EDIFACTDTMvalue (data element 2380) in a format code with no offset (data element 2379).formatEdifactDateTimePeriod: Write two ISO 8601 local date-times as a UN/EDIFACTDTMperiod (data element 2380) in a date-time period format code (data element 2379).formatEdifactOffsetDateTime: Write an ISO 8601 date-time with an offset as a UN/EDIFACTDTMvalue (data element 2380) in a format code that carries an offset (data element 2379).formatEdifactTime: Write an ISO 8601 time as a UN/EDIFACTDTMvalue (data element 2380) in a time format code (data element 2379).formatEpcisEvent: Write an instant-plus-offset pair as the two required time fields of a GS1 EPCIS 2.0 event.formatX12Date: Write an ISO 8601 date as an X12 Date Time Period value (data element 1251) in a date format qualifier (data element 1250).formatX12DateRange: Write two ISO 8601 dates as an X12 Date Time Period range (data element 1251) in a date range format qualifier (data element 1250).formatX12DateTime: Write an ISO 8601 local date-time as an X12 Date Time Period value (data element 1251) in a date-time format qualifier (data element 1250).formatX12DateTimeRange: Write two ISO 8601 local date-times as an X12 Date Time Period range (data element 1251) in a date-time range format qualifier (data element 1250).formatX12Time: Write an ISO 8601 time as an X12 time in a time format qualifier (data element 1250).formatX12TimeElement: Write an ISO 8601 time as an X12 data element 337 (Time) value, in the form the caller names by the element’s own mask.
classifyEdifactDtmFormat: Name the kind of value a UN/EDIFACT data element 2379 format code states, and return the code narrowed to that kind, so a code that arrives as data reaches the function that reads it.classifyX12DateTimePeriodFormat: Name the kind of value an X12 data element 1250 format qualifier states, and return the code narrowed to that kind, so a code that arrives as data reaches the function that reads it.classifyX12TimeCode: Say whether an X12 time code (data element 623) states an offset or names a zone, and return the code narrowed to the function that reads it.parseEdifactDate: Parse a UN/EDIFACTDTMvalue that states a calendar date, as an ISO 8601 date.parseEdifactDatePeriod: Parse a UN/EDIFACTDTMvalue that states a period between two calendar dates, as its start and end.parseEdifactDateTime: Parse a UN/EDIFACTDTMvalue that states a date and a time with no offset, as an ISO 8601 local date-time.parseEdifactDateTimePeriod: Parse a UN/EDIFACTDTMvalue that states a period between two local date-times, as its start and end.parseEdifactOffsetDateTime: Parse a UN/EDIFACTDTMvalue that states a date and a time with an offset from UTC, as an ISO 8601 date-time with its offset.parseEdifactTime: Parse a UN/EDIFACTDTMvalue that states a time of day, as an ISO 8601 time.parseEpcisEvent: Read the two required time fields of a GS1 EPCIS 2.0 event as an instant, the UTC offset in force where the event happened, and the local wall clock there.parseX12Date: Parse an X12 Date Time Period value that states a calendar date, as an ISO 8601 date.parseX12DateAndTime: Read the date and the time of an X12 segment, sent as two elements, as one ISO 8601 local date-time.parseX12DateRange: Parse an X12 Date Time Period value that states a range between two calendar dates, as its start and end.parseX12DateTime: Parse an X12 Date Time Period value that states a date and a time, as an ISO 8601 local date-time.parseX12DateTimeRange: Parse an X12 Date Time Period value that states a range between two local date-times, as its start and end.parseX12Time: Parse an X12 time as an ISO 8601 time: a data element 337 value with no qualifier, or a time that arrives with a data element 1250 format qualifier.x12TimeCodeOffset: Read the UTC offset an X12 time code (data element 623) states.x12TimeCodeZone: Read the zone an X12 time code (data element 623) names.
isValidEdifactDate: Return true whenvalueis a UN/EDIFACTDTMvalue (data element 2380) that states a real calendar date in a date format code (data element 2379).isValidEdifactDatePeriod: Return true whenvalueis a UN/EDIFACTDTMvalue (data element 2380) that states a period between two real calendar dates, in a date period format code (data element 2379).isValidEdifactDateTime: Return true whenvalueis a UN/EDIFACTDTMvalue (data element 2380) that states a real date and time in a format code with no offset (data element 2379).isValidEdifactDateTimePeriod: Return true whenvalueis a UN/EDIFACTDTMvalue (data element 2380) that states a period between two real local date-times, in a date-time period format code (data element 2379).isValidEdifactDtmFormat: Return true whenformatis a UN/EDIFACT data element 2379 format code that the EDIFACT functions read and write.isValidEdifactOffsetDateTime: Return true whenvalueis a UN/EDIFACTDTMvalue (data element 2380) that states a real date and time with an offset from UTC, in a format code that carries one (data element 2379).isValidEdifactTime: Return true whenvalueis a UN/EDIFACTDTMvalue (data element 2380) that states a real time of day in a time format code (data element 2379).isValidEpcisEvent: Validate whether a value carries the two required time fields of a GS1 EPCIS 2.0 event, each in the grammar GS1 publishes for it.isValidEpcisEventTime: Return true whenvalueis a real GS1 EPCIS 2.0eventTime: the moment a supply-chain event happened, written as a date and time withZor a UTC offset.isValidEpcisTimeZoneOffset: Return true whenvalueis a GS1 EPCIS 2.0eventTimeZoneOffset: the UTC offset the local clock ran at where a supply-chain event happened, written±HH:MM.isValidX12Date: Return true whenvalueis an X12 Date Time Period value (data element 1251) that states a real calendar date in a date format qualifier (data element 1250).isValidX12DateAndTime: Return true when the date and the time of an X12 segment, sent as two elements, together state a real local date and time.isValidX12DateRange: Return true whenvalueis an X12 Date Time Period value (data element 1251) that states a range between two real calendar dates, in a date range format qualifier (data element 1250).isValidX12DateTime: Return true whenvalueis an X12 Date Time Period value (data element 1251) that states a real date and time in a date-time format qualifier (data element 1250).isValidX12DateTimePeriodFormat: Return true whenformatis an X12 data element 1250 (Date Time Period Format Qualifier) code that the X12 functions read and write.isValidX12DateTimeRange: Return true whenvalueis an X12 Date Time Period value (data element 1251) that states a range between two real local date-times, in a date-time range format qualifier (data element 1250).isValidX12Time: Return true whenvalueis an X12 time that states a real time of day: a data element 337 value with no qualifier, or a time that fits the data element 1250 format qualifier it arrived with.isValidX12TimeCode: Return true whentimeCodeis one of the 56 X12 data element 623 time codes, the codesx12TimeCodeOffsetandx12TimeCodeZoneread between them.