show log has incorrect date & time

Unanswered Question
Jan 25th, 2006
User Badges:

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
nhabib Wed, 01/25/2006 - 07:37
User Badges:
  • Red, 2250 points or more

Try adding the following command to your config:

service timestamps log datetime show-timezone

david.mitchell@... Wed, 08/08/2012 - 04:40
User Badges:

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


Richard Burts Wed, 08/08/2012 - 10:50
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN


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.




This Discussion