I want to set date from a seconds since epoch value, for instance I want to set date with input value 1452053571
.
I read through date -help
but not found anything.
Is there any parameters to do it?
date
I want to set date from a seconds since epoch value, for instance I want to set date with input value 1452053571
.
I read through date -help
but not found anything.
Is there any parameters to do it?
Best Answer
With GNU date, you can use the same date string format for both
-d
and-s
options.To convert from seconds since epoch to human readable format:
To set it:
With *BSD
date
: