date command

Let us say you need to display time for different zones or cities. Sure you can use The World Clock – Time Zones located here. If you need a different time zone at a shell prompt or script use old good date command. Different timezones can be displayed by changing the TZ environment variable. TZ […]

{ 4 comments }

When invoked without arguments, the date command displays the current date and time. Depending on the options specified, date will set the date and time or print it in a user defined way. I’ve seen many sysadmin writing perl scripts for calculating relative date such as yesterdays or tomorrows day. You can use GNU date command, which is designed to handle relative date calculation such as:

  • 1 Year
  • 2 Days
  • 2 Days ago
  • 5 Years

{ 66 comments }

FreeBSD use the Network Time Protocol (NTP) for synchronizing the clocks of computer systems over packet-switched, variable-latency data networks. NTP uses UDP port 123. If you have one computer or single server then you can easily synchronization time with other NTP servers. All you need is ntp client called ntpdate. It is use to set […]

{ 6 comments }