Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux epoch time

Tags:

linux

time

In Linux, is there an easy way to set the epoch time value directly?? I know there's a bunch of ways to format the date command, but none of them appears to fit our needs.

What we're doing is using an Android phone to set the time on an embedded Linux device when it connects. Getting the epoch time on the Android is a no brainer, but all attempts to get this information accepted by the Linux device have been rebuffed.

like image 534
Rich Avatar asked Feb 24 '26 08:02

Rich


1 Answers

I don't have a machine I can run it on right now, but does:

date -s @1190000000

work for you? (Obviously change the timestamp)

like image 58
Mark Loeser Avatar answered Feb 26 '26 23:02

Mark Loeser



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!