メインコンテンツまでスキップ
バージョン:25.2

timeInputFormat

  • global property

 The timeInputFormat

global property is a list of date and/or time formats that specifies the possible formats that can be used by SenseTalk to interpret strings as dates or times. The default initial setting of the timeInputFormat includes all of the formats that are present as values in the timeFormat global property, plus “iso8601”.

    

    When setting the value of the timeInputFormat, you may set it to a single format value, to a list of format values, or to a property list containing format values. In the latter case, the values from the property list (in sorted key order) will be used. This makes it easy to allow all of the specific formats defined in the timeFormat global property:

         set the timeInputFormat to the timeFormat -- many specific formats

    Because the timeInputFormat is a list, you can easily add additional formats using the insert command:

         insert "[da]/[mo]/[yr]" before the timeInputFormat -- assume d/m/y order
insert "Natural" into the timeInputFormat -- allow natural, last
  • iso8601 option added in 1.53:
    • The timeInputFormat may include a special "iso8601" option, which is included in the initial setting. When "iso8601" is included as one of the entries in the timeInputFormat list, SenseTalk can recognize dates and times in many formats that conform to the ISO 8601 international standard.

    ISO 8601 date formats that are recognized begin with 4 digits for the year followed by 2 digits for the month and 2 digits for the day. The year, month, and day may be separated by a space, dash, or period. Time formats that are recognized begin with a 2-digit hour followed by 2 digits for the minute followed by 2 digits for the second. The second may be followed by a decimal point (or comma) and a fraction of a second. The hour, minute, and second may be separated by a colon or space. If both date and time formats are included, the date format must come first, and may be separated from the time format by a space or a capital letter 'T'.

    Dates must begin with the year (which must always be 4 digits long, using leading zeros for years before 1000). The month and day are optional, but including the day without the month is not permitted. If the day is omitted, the first day of the month is assumed. If both the month and day are omitted, January 1 is assumed. If a date is given without a time, SenseTalk assigns a time of noon on the given date.

    If a time is given it must begin with the hour. The minute and second are optional, but the second cannot be included if no minute is given. If omitted, the minute and second are assumed to be zero.

    A date/time value may be followed by the capital letter 'Z' to designate a zero offset from UTC (Coordinated Universal Time) or a '+' or '-' followed by either 2 or 4 digits to indicate the number of hours, or hours and minutes offset from UTC.

    Currently, SenseTalk will not treat an all-numeric value (all digits and possibly a decimal point) as a date/time, so for any value to be recognized as an ISO 8601 date/time it must include at least one separator between elements, or the letter 'T' after the date or before the time (or between the date and time if both are given), or the letter 'Z' or a time zone offset at the end.

  • Related: timeFormat