To configure the system to time-stamp debugging or logging messages, use one of the service timestamps global configuration commands. Use the no form of this command to disable this service.service timestamps type [uptime]
service timestamps type datetime [msec] [localtime] [show-timezone]
no service timestamps type
Type of message to time stamp: debug or log.
(Optional) Time stamp with time since the system was rebooted.
Time stamp with the date and time.
(Optional) Include milliseconds in the date and time stamp.
(Optional) Time stamp relative to the local time zone.
(Optional) Include the time zone name in the time stamp.
If service timestamps is specified with no arguments or keywords, default is service timestamps debug uptime.
The default for service timestamps type datetime is to format the time in UTC, with no milliseconds and no time zone name.
The command no service timestamps by itself disables time stamps for both debug and log messages.
This command was introduced.
Time stamps can be added to either debugging or logging messages independently. The uptime form of the command adds time stamps in the format HHHH:MM:SS, indicating the time since the system was rebooted. The datetime form of the command adds time stamps in the format MMM DD HH:MM:SS, indicating the date and time according to the system clock. If the system clock has not been set, the date and time are preceded by an asterisk (*) to indicate that the date and time are probably not correct.
The following example enables time stamps on debugging messages, showing the time since reboot:service timestamps debug uptime
The following example enables time stamps on logging messages, showing the current time and date relative to the local time zone, with the time zone name included:service timestamps log datetime localtime show-timezone