Pour formater la manière dont les variables ou les sorties d'une chaîne relatives à la date et à l'heure doivent apparaître, vous pouvez appliquer une transformation Parse Date/Time , et définir la valeur en tant que string format time (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.
-->Valeurs de la date
| Valeur | Exemple | strftime |
|---|---|---|
| Nom de la journée | Dimanche |
%A |
| Nom du jour abrégé | Dim |
%a |
| Jour de la semaine | 0 à 6, où le dimanche est 0 |
%w |
| Année à deux chiffres | 21 |
%y |
| Année à quatre chiffres | 2021 |
%Y |
| Nom du mois complet | Janvier |
%B |
| Nom du mois abrégé | Jan |
%b |
| Mois à deux chiffres | 01 à 12, janvier à décembre |
%m |
| Jour du mois à deux chiffres | 01 à 31 |
%d |
| Jour du mois sans zéro initial | 1 à 31 |
%e |
Vous pouvez enchaîner ces valeurs pour définir un format de date. Par exemple :
| Format de la date | Exemple | strftime |
|---|---|---|
| mm/jj/aaaa | 12/01/2021 |
%m/%d/%Y |
| [Nom du jour complet], [nom du mois complet] [jour du mois sans zéro], [année à quatre chiffres]. | Mercredi 1er décembre 2021 |
%A, %B %e, %Y |
| [Nom abrégé du mois] [jour du mois sans zéro initial] [nom abrégé du jour]. | 1er déc. mer |
%b %e %a |
Valeurs temporelles
| Valeur | Exemple | strftime |
|---|---|---|
| Heure de l'horloge de 24 heures | 00 à 23 |
%H |
| Heure de l'horloge de 12 heures | 01 à 12 |
%I |
| Heure d'une horloge de 12 heures sans zéro initial | 1 à 12 |
%1 |
| Minute | 00 à 59 |
%M |
| Deuxième | 00 à 60 |
%S |
| Ante ou post meridium | AM ou PM |
%p |
| Fuseau horaire | +08 |
%Z |
| Jour de l'année | 001 à 366 |
%m |
| Pourcentage de signe | % |
%% |
Vous pouvez enchaîner ces valeurs pour définir un format d'heure. Par exemple :
| Format de la date | Exemple | strftime |
|---|---|---|
| HH:MM dans l'horloge de 24 heures | 23:01 |
%H:%M |
| H:MM dans l'horloge de 12 heures, avec ante ou 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> -->