cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4796
Views
5
Helpful
3
Replies

show log has incorrect date & time

RVirdi
Level 1
Level 1

The "show clock" command displays the correct time that is obtained using ntp. However, when issuing a "show log" command the output does not contain the date and time, but rather a code such as "2w5d:" at the beginning. Is it possible to change this output to display the date & time?? Thanks in advance.

3 Replies 3

nhabib
Level 9
Level 9

Try adding the following command to your config:

service timestamps log datetime show-timezone

Hi nhabib,

This worked for me so thanks.

My script was slightly different as follows:

service timestamp log datetime msec localtime show-timezone

Thanks again

David

David

If the original poster had looked in the router config he would have found a command service timestamps log uptime. This is the default on many versions of IOS and will display the amount of time (2 weeks 5 days in the original post) that the router has been up.

There are a number of optional parameters that can be used and you used several of them. The important thing is that you need to use at least service timestamps log datetime. This will give you the date and time rather than the uptime. Beyond that you can specify other parameters to specify how you want the time displayed.

HTH

Rick

HTH

Rick
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: