Veja como obter o timestamp Unix atual nas principais linguagens. A maioria retorna segundos (10 dígitos) ou milissegundos (13 dígitos).
- JavaScript —
Math.floor(Date.now() / 1000)(segundos),Date.now()(milissegundos) - Python —
int(time.time()) - Java —
System.currentTimeMillis() / 1000L - PHP —
time() - Go —
time.Now().Unix() - Ruby —
Time.now.to_i - C# —
DateTimeOffset.UtcNow.ToUnixTimeSeconds() - Swift —
Int(Date().timeIntervalSince1970) - Bash —
date +%s - MySQL —
SELECT UNIX_TIMESTAMP()
Tenha cuidado para não confundir segundos com milissegundos. Cole qualquer valor no conversor no topo do site para vê-lo como uma data legível instantaneamente.