Getting the current date and time

Tcl offers time package that can be used to query current time using either official servers for providing it or local servers within our network.

One of the reasons is that applications that operate over the network need to know and use the current time. For example, if multiple machines register events and/or data updates based on the time they occurred, if their system clocks are not synchronized, events might be reported out of order.

In majority of cases the system clock is synchronized so all applications use the correct time, but in some cases it might only be possible for the application to synchronize its time and handle it properly whenever sending a time.

The time package offers similar commands to dns ...

Get Tcl 8.5 Network Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.