Make sar display in military time
Jump to navigation
Jump to search
When graphing sar data, it is a problem to convert the default AM/PM time to military time. It is certainly possible to script up a filter to manage this, but there are lots of corner cases and is tedious. So it is handy to know that you can just set the locale environment variable to get the behavior you want:
rday@muno:~$ sar 09:55:02 AM CPU %user %nice %system %iowait %steal %idle 10:05:01 AM all 19.60 0.03 4.37 0.04 0.00 75.96 10:15:01 AM all 17.22 0.03 3.30 0.04 0.00 79.42 10:25:01 AM all 19.28 0.03 3.64 0.04 0.00 77.01
rday@muno:~$ LANG=C sar 09:55:02 CPU %user %nice %system %iowait %steal %idle 10:05:01 all 19.60 0.03 4.37 0.04 0.00 75.96 10:15:01 all 17.22 0.03 3.30 0.04 0.00 79.42