Skip to main content

Green hexagon with a white calendar and clock in the middle. Strumento Data e ora

Esempio di uno strumento

Data e ora dispone dell'opzione Esempio di uno strumento. Consulta Esempi di flussi di lavoro per scoprire come accedere a questo e a molti altri esempi direttamente in Alteryx Designer.

Usa lo strumento Data e ora per modificare i dati relativi a data/ora in e da una varietà di formati, compresi quelli per le espressioni e per una chiara lettura. È inoltre possibile specificare la lingua dei dati relativi alla data e all'ora. Quando si trasportano operazioni con 2 dati data/ora di diversa precisione, prevale la precisione più elevata. Per formattare formati di data e ora più precisi come stringhe, è necessario inserire un Strumento Seleziona prima di scrivere in un database.

Configura lo strumento

Collega un'origine dati all'ancoraggio di input dello strumento Data e ora . Nella finestra Configurazione , seleziona il formato da convertire. Sono disponibili 2 opzioni:

  1. Da formato data/ora a stringa : converte il formato dati di data/ora in una stringa.

    • Seleziona il campo data/ora da convertire : seleziona il menu a discesa per scegliere un campo data/ora (colonna). Se non sono disponibili colonne data-ora, il campo appare in grigio e riporta la dicitura Nessun campo di input adatto disponibile .

    • Specifica il nome della nuova colonna : immetti un nome per la nuova colonna per i dati convertiti o utilizza il valore predefinito DateTime_Out .

    • Specifica la lingua di data/ora : seleziona il menu a discesa per scegliere la lingua per l'output della nuova colonna di stringhe. Per un elenco dei formati per lingua, consulta la sezione Impostazione della lingua di data e ora di seguito.

    • Seleziona il formato per la nuova colonna : seleziona il formato per la nuova colonna dall'elenco oppure seleziona Personalizzato per creare il tuo formato tramite il campo Specifica un formato personalizzato per la nuova colonna . Consulta la sezione Formato personalizzato di seguito.

  2. Da stringa a formato data/ora : converte i dati di stringa in formato data e ora.

    • Seleziona il campo stringa da convertire : seleziona il menu a discesa per scegliere un campo stringa (colonna) da convertire in un formato data-ora. Se non sono disponibili colonne di stringhe, il campo appare in grigio e riporta la dicitura Nessun campo di input adatto disponibile .

    • Specifica il nome della nuova colonna : immetti un nome per la nuova colonna per i dati convertiti o utilizza il valore predefinito DateTime_Out .

    • Specifica la lingua di data/ora : seleziona il menu a discesa per identificare la lingua dei dati stringa in entrata. Per un elenco dei formati per lingua, consulta la sezione Impostazione della lingua di data e ora di seguito.

    • Seleziona il formato che corrisponde al campo della stringa in entrata : seleziona il formato della stringa in entrata dall'elenco oppure seleziona Personalizzato per identificare un formato diverso tramite la sezione Specifica il formato del campo stringa in entrata . Consulta la sezione Formato personalizzato di seguito.

Formato personalizzato

È possibile specificare un formato personalizzato che corrisponda al campo stringa in entrata o al nuovo campo stringa creato.

  1. Seleziona Personalizzato per immettere il tuo formato. Designer visualizza un esempio in base al formato immesso.

  2. Usa gli indicatori e i separatori descritti di seguito (ad esempio, dd, MM, yyyy) o gli indicatori e i separatori supportati dalle funzioni DateTimeParse e DateTimeFormat  Data e ora (per esempio, %d, %m, %Y).

    Avvertimento

    You cannot mix the pattern style formatting with the percent style formatting when using the Custom format option of the DateTime tool.

    For example, if you currently have a DateTime tool that converts a string to date/time format using this custom format: %B dd %Y (using both pattern-style and percent-style formatting), you will need to update it to either: Month dd yyyy (or similar) or %B %d %Y (or similar). Note that each of these use one of pattern-style or percent-style formatting, rather than a mix of both.

È possibile utilizzare un asterisco ( *) come carattere jolly per sostituire qualsiasi carattere nel campo formato data.

  • d : giorno del mese in cifre, senza zeri iniziali per i giorni a una cifra.

  • day : il nome completo del giorno della settimana.

  • dd : giorno a 2 cifre, con zeri iniziali per i giorni a una cifra. Nell'input, gli zeri iniziali sono opzionali.

  • dy : giorno della settimana come abbreviazione di 3 lettere. Nell'input, i nomi completi sono accettati ma Alteryx non controlla che il giorno della settimana corrisponda al resto della data.

  • EEE : il nome completo del giorno della settimana.

  • M : mese a una cifra, senza lo zero iniziale.

  • MM : mese in cifre, con zeri iniziali per i mesi a una cifra. Nell'input, gli zeri iniziali sono opzionali.

  • MMM : il nome abbreviato del mese.

  • MMMM : il nome del mese per esteso.

  • Mon : abbreviazione di 3 lettere del nome del mese. Nell'input, vengono accettati anche i nomi completi.

  • Month : nome del mese. Nell'input, vengono accettate anche le abbreviazioni.

  • yy : anno rappresentato solo dalle ultime due cifre. Durante la conversione da una stringa, gli anni a due cifre vengono mappati nell'intervallo dall'anno corrente, meno 66 anni all'anno corrente, più 33 anni. Per esempio, nel 2016, un anno a due cifre sarà mappato nell'intervallo: da 1950 a 2049. Nell'input, vengono accettate anche quattro cifre.

  • yyyy : anno rappresentato dalle 4 cifre complete. Nell'input, vengono accettate e mappate anche 2 cifre come per il modello "yy".

    Limitation with 6-Digit Dates

    Because up to 4 digits are read for the year, formats that are intended to have only 2 digits without a separator, such as a 6-digit date stamp (for example, %y%m%d for data resembling 170522 for May 22, 2017), are still read as 4 digits. To work around this limitation, you can...

    • Depending on your range of dates, use four digits for the year (for example, 2017 instead of 17).

    • Use the RegEx tool to insert a space after the first 2 digits in the string.

  • ahh : AM/PM (solo cinese semplificato).

  • H : ora, senza zero iniziali per ore a una cifra (orologio a 24 ore).

  • HH o hh : ore, con zeri iniziali per ore a una cifra (orologio a 24 ore).

  • mm: minuti, con zeri iniziali per minuti a una cifra.

  • ss: secondi, con zeri iniziali per secondi a una cifra.

  • ffff : precisione, il numero di caratteri 'f' indica il numero di cifre da utilizzare per i sottosecondi (ad esempio: fff per millisecondi, ffff per microsecondi, ecc.).

Nell'output, i separatori nel formato data/ora vengono utilizzati in modo esatto. Nell'input...

  • - e / sono accettati come equivalenti.

  • Lo spazio vuoto viene ignorato.

  • : e , devono corrispondere esattamente.

Specify Your DateTime Language

  • Date/Time Format to String: When you convert date-time data to string data, use the Specify your DateTime Language dropdown to choose the language for your new string column output. Depending on the language, different format options are available.

  • String to Date/Time Format: When you convert string data to date-time data, use the Specify your DateTime Language dropdown to identify the language of the incoming string data. Depending on the language, different format options are available.

English

Date/Time Format to String

String to Date/Time Format

day, dd Month, yyyy

yyyy-MM-dd hh:mm:ss

dd-MM-yy

MM/dd/yyyy hh:mm:ss

dd-MM-yyyy

MM/dd/yy hh:mm:ss

dd-Mon,-yy

dd/MM/yyyy hh:mm:ss

dd Month, yyyy

dd/MM/yy hh:mm:ss

dd/MM/yy

day, dd Month, yyyy

dd/MM/yyyy

dd-MM-yy

dy., Month dd, yyyy

dd-MM-yyyy

MM-dd-yy

dd-Mon.-yy

MM-dd-yyyy

dd Month, yyyy

MM/dd/yy

dd/MM/yy

MM/dd/yyyy

dd/MM/yyyy

Mon dd

dy., Month dd, yyyy

Month dd, yyyy

MM-dd-yy

Month, yyyy

MM-dd-yyyy

yyyy-MM-dd

MM/dd/yy

yyyyMMdd

MM/dd/yyyy

yyyy/MM/dd

Month dd, yyyy

yyyy-MM-dd hh:mm:ss

Month, yyyy

MM/dd/yyyy hh:mm:ss

yyyy-MM-dd

dd/MM/yyyy hh:mm:ss

yyyyMMdd

Custom

yyyy/MM/dd

HH:mm:ss

Custom

简体中文 (Simplified Chinese)

Date/Time Format to String

String to Date/Time Format

yyyy'年'M'月'd'日'

yyyy'年'M'月'd'日' ahh'时'mm'分'ss'秒'

yyyy'年'M'月'd'日'day

yyyy-MM-dd hh:mm:ss

yyyy-MM-dd

yyyy'年'M'月'd'日'

yyyyMMdd

yyyy'年'M'月'd'日'day

yyyy/MM/dd

yyyy-MM-dd

yyyy'年'M'月'd'日' ahh'时'mm'分'ss'秒'

yyyyMMdd

yyyy-MM-dd hh:mm:ss

yyyy/MM/dd

HH:mm:ss

Custom

Français (French)

Date/Time Format to String

String to Date/Time Format

d Mon yy

d Mon yy HH:mm:ss

d Month yyyy

yyyy-MM-dd hh:mm:ss

day d Month yyyy

dd/MM/yyyy hh:mm:ss

dd-MM-yy

dd/MM/yy hh:mm:ss

dd-MM-yyyy

d Mon yy

dd/MM/yy

d Month yyyy

dd/MM/yyyy

day d Month yyyy

yyyyMMdd

dd-MM-yy

yyyy/MM/dd

dd-MM-yyyy

d Mon yy HH:mm:ss

dd/MM/yy

yyyy-MM-dd hh:mm:ss

dd/MM/yyyy

dd/MM/yyyy hh:mm:ss

yyyy-MM-dd

dd/MM/yy hh:mm:ss

yyyyMMdd

Custom

yyyy/MM/dd

HH:mm:ss

Custom

Deutsch (German)

Date/Time Format to String

String to Date/Time Format

dd.MM.yy

dd.MM.yy HH:mm

dd.MM.yyyy

dd.MM.yyyy HH:mm:ss

d. Month yyyy

yyyy-MM-dd hh:mm:ss

day, dd. Month yyyy

dd/MM/yyyy hh:mm:ss

day d. Month yyyy

dd/MM/yy hh:mm:ss

dd-MM-yy

dd.MM.yy

dd-MM-yyyy

dd.MM.yyyy

dd/MM/yy

d. Month yyyy

dd/MM/yyyy

day, dd. Month yyyy

yyyy-MM-dd

day, d. Month yyyy

yyyyMMdd

dd-MM-yy

yyyy/MM/dd

dd-MM-yyyy

dd.MM.yy HH:mm

dd/MM/yy

dd.MM.yyyy HH:mm:ss

dd/MM/yyyy

yyyy-MM-dd hh:mm:ss

yyyy-MM-dd

dd/MM/yyyy hh:mm:ss

yyyyMMdd

dd/MM/yy hh:mm:ss

yyyy/MM/dd

Custom

HH:mm:ss

Custom

Italiano (Italian)

Date/Time Format to String

String to Date/Time Format

dd/Mon/yy

dd/Mon/yy HH:mm:ss

dd Month yyyy

yyyy-MM-dd hh:mm:ss

day d Month yyyy

dd/MM/yyyy hh:mm:ss

dd-MM-yy

dd/MM/yy hh:mm:ss

dd-MM-yyyy

dd/Mon/yy

dd/MM/yy

dd Month yyyy

dd/MM/yyyy

day d Month yyyy

yyyy-MM-dd

dd-MM-yy

yyyyMMdd

dd-MM-yyyy

yyyy/MM/dd

dd/MM/yy

dd/Mon/yy HH:mm:ss

dd/MM/yyyy

yyyy-MM-dd hh:mm:ss

yyyy-MM-dd

dd/MM/yyyy hh:mm:ss

yyyyMMdd

dd/MM/yy hh:mm:ss

yyyy/MM/dd

Custom

HH:mm:ss

Custom

日本語 (Japanese)

Date/Time Format to String

String to Date/Time Format

yyyy'年'M'月'd'日'day

yyyy-MM-dd hh:mm:ss

yyyy'年'M'月'd'日'

yyyy'年'M'月'd'日'day

M'月'd'日'

yyyy'年'M'月'd'日'

yyyy-MM-dd

M'月'd'日'

yyyyMMdd

yyyy-MM-dd

yyyy/MM/dd

yyyyMMdd

yyyy-MM-dd hh:mm:ss

yyyy/MM/dd

Custom

hh'時'mm'分'ss'秒'

HH:mm:ss

Custom

Português (Portuguese)

Date/Time Format to String

String to Date/Time Format

d' de 'Month' de 'yyyy

yyyyMMdd H.mm

day, d' de 'Month' de 'yyyy

yyyy-MM-dd hh:mm:ss

dd-MM-yy

dd/MM/yyyy hh:mm:ss

dd-MM-yyyy

dd/MM/yy hh:mm:ss

dd/MM/yy

d' de 'Month' de 'yyyy

dd/MM/yyyy

day, d' de 'Month' de 'yyyy

yyyy-MM-dd

dd-MM-yy

yyyyMMdd

dd-MM-yyyy

yyyy/MM/dd

dd/MM/yy

yyyyMMdd H.mm

dd/MM/yyyy

yyyy-MM-dd hh:mm:ss

yyyy-MM-dd

dd/MM/yyyy hh:mm:ss

yyyyMMdd

dd/MM/yy hh:mm:ss

yyyy/MM/dd

Custom

HH:mm:ss

Custom

Español (Spanish)

Date/Time Format to String

String to Date/Time Format

d' de 'Month' de 'yyyy

yyyyMMdd H.mm

day d' de 'Month' de 'yyyy

yyyy-MM-dd hh:mm:ss

dd-MM-yy

dd/MM/yyyy hh:mm:ss

dd-MM-yyyy

dd/MM/yy hh:mm:ss

dd/MM/yy

d' de 'Month' de 'yyyy

dd/MM/yyyy

day d' de 'Month' de 'yyyy

yyyyMMdd

dd-MM-yy

yyyy/MM/dd

dd-MM-yyyy

yyyyMMdd H.mm

dd/MM/yy

yyyy-MM-dd hh:mm:ss

dd/MM/yyyy

dd/MM/yyyy hh:mm:ss

yyyy-MM-dd

dd/MM/yy hh:mm:ss

yyyyMMdd

Custom

yyyy/MM/dd

HH:mm:ss

Custom