Funzione TO_STRING in Amazon QLDB - Database Amazon Quantum Ledger (Amazon QLDB)

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

Funzione TO_STRING in Amazon QLDB

In Amazon QLDB, utilizza laTO_STRING funzione per restituire una rappresentazione in formato stringa di un determinato timestamp nel modello di formato specificato.

Sintassi

TO_STRING ( timestamp, 'format' )

Argomenti

timestamp

Il nome del campo o l'espressione del tipo di datitimestamp che la funzione converte in una stringa.

Un valore letterale del timestamp di Ion può essere indicato con backticks (`...`). Per dettagli sulla formattazione ed esempi di valori di timestamp, consulta Timestamp nel documento con le specifiche di Amazon Ion.

format

La stringa letterale che specifica il modello di formato del risultato, in termini di parti di data. Per i formati validi, consultare Stringhe in formato timestamp.

Tipo restituito

string

Esempi

TO_STRING(`1969-07-20T20:18Z`, 'MMMM d, y') -- "July 20, 1969" TO_STRING(`1969-07-20T20:18Z`, 'MMM d, yyyy') -- "Jul 20, 1969" TO_STRING(`1969-07-20T20:18Z`, 'M-d-yy') -- "7-20-69" TO_STRING(`1969-07-20T20:18Z`, 'MM-d-y') -- "07-20-1969" TO_STRING(`1969-07-20T20:18Z`, 'MMMM d, y h:m a') -- "July 20, 1969 8:18 PM" TO_STRING(`1969-07-20T20:18Z`, 'y-MM-dd''T''H:m:ssX') -- "1969-07-20T20:18:00Z" TO_STRING(`1969-07-20T20:18+08:00Z`, 'y-MM-dd''T''H:m:ssX') -- "1969-07-20T20:18:00Z" TO_STRING(`1969-07-20T20:18+08:00`, 'y-MM-dd''T''H:m:ssXXXX') -- "1969-07-20T20:18:00+0800" TO_STRING(`1969-07-20T20:18+08:00`, 'y-MM-dd''T''H:m:ssXXXXX') -- "1969-07-20T20:18:00+08:00" -- Runnable statements SELECT TO_STRING(`1969-07-20T20:18Z`, 'MMMM d, y') FROM << 0 >> -- "July 20, 1969" SELECT TO_STRING(`1969-07-20T20:18Z`, 'y-MM-dd''T''H:m:ssX') FROM << 0 >> -- "1969-07-20T20:18:00Z"

Funzioni correlati correlati correlati