Aby sformatować sposób wyświetlania zmiennych daty i znacznika czasu lub danych wyjściowych w łańcuchu, możesz zastosować transformację a Parse Date/Time i ustawić wartość jako czas w formacie łańcuchowym (strftime).
<!--<ul> <li> Paste the raw transformation as the command property's value. </li> </ul>String format time
To use a Parse Date/Time transformation to set the format of a date or timestamp, enter its values as strftime.
-->Wartości daty
| Wartość | Przykład | strftime |
|---|---|---|
| Nazwa całego dnia | Niedziela |
%A |
| Skrócona nazwa dnia | Słońce |
%a |
| Dzień tygodnia | 0 do 6, gdzie niedziela to 0 |
%w |
| Rok dwucyfrowy | 21 |
%y |
| Czterocyfrowy rok | 2021 |
%Y |
| Pełna nazwa miesiąca | Styczeń |
%B |
| Skrócona nazwa miesiąca | Jan |
%b |
| Miesiąc dwucyfrowy | 01 do 12, od stycznia do grudnia |
%m |
| Dwucyfrowy dzień miesiąca | 01 do 31 |
%d |
| Dzień miesiąca bez początkowego zera | 1 do 31 |
%e |
Możesz połączyć te wartości, aby ustawić format daty. Na przykład:
| Format daty | Przykład | strftime |
|---|---|---|
| mm/dd/rrrr | 12/01/2021 |
%m/%d/%Y |
| [pełna nazwa dnia], [pełna nazwa miesiąca] [dzień miesiąca bez początkowego zera], [czterocyfrowy rok] | Środa, 1 grudnia 2021 r |
%A, %B %e, %Y |
| [skrócona nazwa miesiąca] [dzień miesiąca bez początkowego zera] [skrócona nazwa dnia] | 1 grudnia środa |
%b %e %a |
Wartości czasu
| Wartość | Przykład | strftime |
|---|---|---|
| Godzina zegara 24-godzinnego | 00 do 23 |
%H |
| Godzina zegara 12-godzinnego | 01 do 12 |
%I |
| Godzina zegara 12-godzinnego bez zera początkowego | 1 do 12 |
%1 |
| Minuta | 00 do 59 |
%M |
| Drugi | 00 do 60 |
%S |
| Ante lub post meridium | AM lub PM |
%p |
| Strefa czasowa | +08 |
%Z |
| Dzień roku | 001 do 366 |
%m |
| Znak procentu | % |
%% |
Możesz połączyć te wartości, aby ustawić format czasu. Na przykład:
| Format daty | Przykład | strftime |
|---|---|---|
| GG:MM w zegarze 24-godzinnym | 23:01 |
%H:%M |
| H:MM w zegarze 12-godzinnym, z ante lub post meridium | 4:31 PM |
%1:%M %p |
Raw transformations
Rather than apply a transformation to a variable or output used as a command property, you can copy and paste these raw transformations in the command property:
<h3>Timestamp</h3>For a full date and timestamp value, such as 2021-03-15T16:04:28.744118Z:
<pre>$(Chain.ExecutionDateTime)</pre> <h3>Time</h3>For the hour and minutes, such as 1610:
<pre>$(Chain.ExecutionDateTime)@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%H%MOC_ARGOC_ARGOC_ARG}</pre>For the hour, minutes, and seconds, such as 161051:
<pre>$(Chain.ExecutionDateTime)@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%H%M%SOC_ARGOC_ARGOC_ARG}</pre> <h3>Date</h3>With date values, the raw transformation can set the format for the current date or include subtractions to set previous years' values.
<h4>Current year</h4>For the current, four-digit year:
<pre>$(Chain.ExecutionDateTime)@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%YOC_ARGOC_ARGOC_ARG}</pre>For the current month and four-digit year:
<pre>$(Chain.ExecutionDateTime)@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%m%YOC_ARGOC_ARGOC_ARG}</pre>For the full current date, starting with the day, such as 31102021:
<pre>$(Chain.ExecutionDateTime)@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%d%m%YOC_ARGOC_ARGOC_ARG}</pre>For the full current date, starting with the month, such as 10312021:
<pre>$(Chain.ExecutionDateTime)@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%m%d%YOC_ARGOC_ARGOC_ARG}</pre> <h4>Previous year</h4>For the previous, four-digit year:
<pre>$(Chain.ExecutionDateTime)@transform{dateMathOC_SPLIT%FT%T.%fZOC_ARGsubtractOC_ARG1OC_ARGyearsOC_ARG}@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%YOC_ARGOC_ARGOC_ARG}</pre>For the current month a year ago:
<pre>$(Chain.ExecutionDateTime)@transform{dateMathOC_SPLIT%FT%T.%fZOC_ARGsubtractOC_ARG1OC_ARGyearsOC_ARG}@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%m%YOC_ARGOC_ARGOC_ARG}</pre>For the current date a year ago, starting with the day, such as 31102020:
<pre>$(Chain.ExecutionDateTime)@transform{dateMathOC_SPLIT%FT%T.%fZOC_ARGsubtractOC_ARG1OC_ARGyearsOC_ARG}@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%d%m%YOC_ARGOC_ARGOC_ARG}</pre>For the current date a year ago, starting with the month, such as 10312020:
<pre>$(Chain.ExecutionDateTime)@transform{dateMathOC_SPLIT%FT%T.%fZOC_ARGsubtractOC_ARG1OC_ARGyearsOC_ARG}@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%m%d%YOC_ARGOC_ARGOC_ARG}</pre> <h4>The year before last</h4>For the four-digit year, two years ago:
<pre>$(Chain.ExecutionDateTime)@transform{dateMathOC_SPLIT%FT%T.%fZOC_ARGsubtractOC_ARG2OC_ARGyearsOC_ARG}@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%YOC_ARGOC_ARGOC_ARG}</pre>For the current month two years ago:
<pre>$(Chain.ExecutionDateTime)@transform{dateMathOC_SPLIT%FT%T.%fZOC_ARGsubtractOC_ARG2OC_ARGyearsOC_ARG}@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%m%YOC_ARGOC_ARGOC_ARG}</pre>For the current date two years ago, starting with the day, such as 31102019:
<pre>$(Chain.ExecutionDateTime)@transform{dateMathOC_SPLIT%FT%T.%fZOC_ARGsubtractOC_ARG2OC_ARGyearsOC_ARG}@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%d%m%YOC_ARGOC_ARGOC_ARG}</pre>For the current date a year ago, starting with the month, such as 10312019:
<pre>$(Chain.ExecutionDateTime)@transform{dateMathOC_SPLIT%FT%T.%fZOC_ARGsubtractOC_ARG2OC_ARGyearsOC_ARG}@transform{parseDateTimeOC_SPLIT%FT%T.%fZOC_ARG%m%d%YOC_ARGOC_ARGOC_ARG}</pre> -->