1

1633036680022 , This is epoch result i got from elasticsearch. if i tried to convert this epcho to human-readable date,

  1. So i used epochconverter enter image description here
  2. And i used bash command to convert this in my terminal,
$ date -d @1633036680022

Tuesday 15 November 53718 05:30:22 PM IST

This output from terminal say the Year 53718, because the epoch '1633036680022' is in milliseconds.

All i want is ,epoch in seconds.

praveen
  • 179
  • 1
  • 3
  • 16

2 Answers2

1

You can divide by 1000 and convert to timestamp.

date -d @"$(echo "1633036680022/1000" | bc)"
过过招
  • 3,722
  • 2
  • 4
  • 11
1

Strip milliseconds with bash (output only first 10 digits):

x="1633036680022"
date -d "@${x:0:10}"
Cyrus
  • 84,225
  • 14
  • 89
  • 153