Format DateTime

You can use this step to convert a Date, Time, or DateTime value into a Text value. The step can be inserted from the Robot workflow only.

Properties

Pattern

Various formats that can be used for formatting the Date, Time, or DateTime value.

  • Predefined: Standard extraction formats based on various date formats, such as ISO. You can find a complete list of predefined formats on the docs.oracle.com website.

  • Default Patterns: A set of commonly used patters to choose from, such as yyyy-M-d. Note that selecting a Target Type has effect on which patterns will be available on the list.

  • Calculated: A pattern that you can create as a constant or with an expression. This option provides the same formats as the Default Patterns option. The patterns consist of letters and combinations of letters, each corresponding to parts of a date, as shown in the following table.

    Letter Description Example
    G time period (BC or AD) G matches BC or AD; GGGG matches Before Christ or Anno Domini; GGGGG matches B or A
    z time zone ID z, zz, and zzz match CET; zzzz matches both CET and Central European Time
    Z time zone UTC offset Z, ZZ, and ZZZ match +0100; ZZZZ matches GMT+01:00; ZZZZZ matches +01:00
    y year yyyy matches 2022; yy matches 22
    Q quarter of year Q matches 1; QQ matches 01; QQQ matches Q1
    M month M matches 7 or 07; MM matches 07; MMM matches Jul; and MMMM matches July
    w week number of year w matches 3 or 12; ww matches 12
    d day d matches 1 or 01; dd matches 01
    E day of week EEE matches Mon; EEEE matches Monday
    h hour of clock (1 -12 AM or PM) H matches 0 or 23; h and hh match 01 or 12 and usually require an a pattern for AM or PM
    a AM or PM a matches AM or pm
    m minutes mm matches 00 or 43
    s seconds ss matches 00 or 43
    S fraction of second SSS matches 123

    Also note:

    • Patterns can contain characters such as "-" (hyphen), "/" (slash), and space to separate parts of a date.
    • You can include text in a pattern by enclosing it in single quotation marks, such as 'Day' d 'of the month' MMMM 'in the year' yyyy, which would result in "Day 3 of the month July in the year 2022".
    • The count of pattern letters determines the result format. For example, with digits, if the count of letters is one, the result would contain any number of digits (d may result in 1, 01 or 31). Otherwise, the count describes the width of the result, such as with month names: a count of three denotes a short form (Jul) and a count of four denotes a full form (July).

      For more information, see the docs.oracle.com website.

Locale
Contains a list of the available locales. A locale specifies a given language and a region that must be separated by a hyphen ("en-US"). As different languages use different approaches to identify a date, you can use this option to take language specifics into account, such as month names. For example, if the locale is set to en-US, MMMM d, yyyy would result in July 4, 2021. If set to fr-FR, the result would be juillet 4, 2021.

Note that time zones are not affected by the locales.