Skip to main content

Time.FromText

Δημιουργεί μια ώρα από τοπικές και καθολικές και προσαρμοσμένες μορφές ώρας.

Syntax

Time.FromText(
text as text,
optional options as any
) as time

Remarks

Creates a time value from a textual representation, text. An optional record parameter, options, may be provided to specify additional properties. The record can contain the following fields:

  • Format: A text value indicating the format to use. For more details, go to https://go.microsoft.com/fwlink/?linkid=2180104 and https://go.microsoft.com/fwlink/?linkid=2180105. Omitting this field or providing null will result in parsing the time using a best effort.
  • Culture: When Format is not null, Culture controls some format specifiers. For example, in "en-US" "tt" is "AM" or "PM", while in "ar-EG" "tt" is "ص" or "م". When Format is null, Culture controls the default format to use. When Culture is null or omitted, Culture.Current is used.

To support legacy workflows, options may also be a text value. This has the same behavior as if options = [Format = null, Culture = options].

Examples

Example #1

Μετατρέψτε την "10:12:31am" σε τιμή ώρας.

Time.FromText("10:12:31am")

Result:

#time(10, 12, 31)

Example #2

Μετατρέψτε το "1012" σε τιμή ώρας.

Time.FromText("1012")

Result:

#time(10, 12, 00)

Example #3

Μετατρέψτε το "10" σε τιμή ώρας.

Time.FromText("10")

Result:

#time(10, 00, 00)

Category

Time