cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2665
Views
0
Helpful
4
Replies

datetime vs uptime !?

mohammed hashim
Level 1
Level 1

hi,

 

could you please tell me what is the difference between datetime and uptime !?

 

when we configure:

 

service timestamps log uptime

and

service timestamps log datetime 

 

????

4 Replies 4

Terry Cheema
VIP Alumni
VIP Alumni

service timestamps log uptime

This command enables timestamps on log messages, showing the time since the system was rebooted.

So it shows logs with uptime i.e. time since the system has been up after a reboot.

service timestamps log datetime 

The second command enables timestamps on log messages. Depending on the options selected, the timestamp can include the date, time in milliseconds relative to the local time zone, and the time zone name.

This example shows part of a logging display with the service timestamps log datetime global configuration command enabled:

*Mar  1 18:46:11: %SYS-5-CONFIG_I: Configured from console by vty2 (10.34.195.36)


 

This example shows part of a logging display with the service timestamps log uptime global configuration command enabled:

00:00:46: %LINK-3-UPDOWN: Interface Port-channel1, changed state to up

Ref: http://www.cisco.com/c/en/us/td/docs/wireless/access_point/12-4_10b_JA/configuration/guide/scg12410b/scg12410b-chap21-msg-logging.html#wp1035007

 

-Terry

thanks a lot Terry,

 

your explanation is very clear,

 

could you please tell me how to configure date and time for cisco device !?

I want to modify it on the router because it does not read correct timing,

 

 

The answer about how to configure it depends on what platform you are talking about and also on how you want to determine the time.

 

Let me start from what is the better solution which is to have the router or switch learn time from an NTP source. Some organizations have an authoritative time source inside their network. And some organizations do not have their own time source and learn time from an NTP server in the Internet (there are a lot of available time servers). If you configure the router or switch to learn time from NTP there are several advantages including that the time will be more accurate and that it will not require any more manual intervention.

 

Some routers and switches have an internal clock and once their time has been set manually they will continue to maintain time through power cycles and device reloads. Other routers and switches do not have internal clocks and will need to have the time set after every power cycle or device reload.

 

For most of your devices if you need to manually set the time it will use a command something like this

clock set <mm><dd><yyyy><hh><mm><ss>

 

HTH

 

Rick

HTH

Rick

thank you very much