# Notes: dates and times in Linux
Date manipulation:
- Program for checking and setting dates:
date - Date format is a little counter-intuitive:
MMDDhhmm[[CC]YY][.ss] - TODO: notes on syncing to hardware clocks and back.
Time zones:
- Timezone is stored as text in file
/etc/timezone - The file
/etc/localtimewill be a link to a timezone file in/usr/share/zoneinfo - when first installed, the
localtimeis often a copy of the timezone data file, not a link. - script to view/change the timezone:
tzconfig. - (Can also use
tzselectto set, it's a bit more primitive) - you need to restart daemons and long-running programs for them to see the new timezone.
- see Debian's TimeZoneChanges wiki page for commands to decipher the content of timezone data files.
Set time from a time server:
ntpdate 0.pool.ntp.org
This connects to a load-balancer at ntp.org. You could also select a time server directly.
Links:
Last modified: {2007.03.25 14.01}