1

Is there a way to tell this command to output the data in local time (not UTC)?

last reboot

Version:

last --version
last von util-linux 2.27.1
1
  • 1
    Does last reboot not honour the TZ environment variable? I don't have any machines that have rebooted since the start of wtmp, but certainly logins and the wtmp start date are printed according to TZ ("last from util-linux 2.28.1"). E.g. TZ=UTC last reboot or TZ=Australia/Perth last reboot. Commented Aug 24, 2016 at 15:31

1 Answer 1

2

Use TZ if you need some (troublesome on account of the horrible daylight savings time swings) local timezone, as @Toby indicates:

% TZ=US/Pacific last | sed -n /reboot/p | sed -n 1p
reboot   system boot  2.6.32-642.1.1.e Mon Jul 25 09:55 - 08:47 (29+22:51)  
% last | sed -n /reboot/p | sed -n 1p 
reboot   system boot  2.6.32-642.1.1.e Mon Jul 25 16:55 - 15:47 (29+22:51)  
%
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .