Aller au contenu

Convertit un timestamp au format date/heure en timestamp Unix. Un timestamp Unix représente le nombre de secondes écoulées depuis le 1er janvier 1970 à 00:00:00 UTC.

func.to_unix_timestamp(<expr>)
func.to_unix_timestamp('2023-11-12 09:38:18.165575')
┌────────────────────────────────────────────────────────────────┐
│ func.to_unix_timestamp('2023-11-12 09:38:18.165575') │
│ UInt32 │
├────────────────────────────────────────────────────────────────┤
│ 1699781898 │
└────────────────────────────────────────────────────────────────┘
TO_UNIX_TIMESTAMP(<expr>)
Arguments Description
<expr> Timestamp

Pour plus d’informations sur le type de données timestamp, consultez Date & Time.

BIGINT

SELECT
to_unix_timestamp('2023-11-12 09:38:18.165575')
┌─────────────────────────────────────────────────┐
│ to_unix_timestamp('2023-11-12 09:38:18.165575') │
│ UInt32 │
├─────────────────────────────────────────────────┤
│ 1699781898 │
└─────────────────────────────────────────────────┘