Linux command
zic 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Compile timezone data
zic [path/to/tzdata_file]
Compile to a specific
zic -d [path/to/output_directory] [path/to/tzdata_file]
Compile with leap second
zic -L [path/to/leapseconds] [path/to/tzdata_file]
Set local timezone
sudo zic -l [America/New_York]
Compile with verbose
zic -v [path/to/tzdata_file]
Read timezone data from stdin
zic -d [path/to/output_directory] -
说明
zic is the timezone compiler. It reads text files describing timezone rules (zone names, UTC offsets, daylight saving transitions) and produces binary TZif (Time Zone Information Format) files used by the C library's localtime() and related functions. Input files use a specific format with Rule, Zone, and Link lines that define timezone transitions. The compiled binary files are typically installed in /usr/share/zoneinfo/. The zic compiler is normally run as part of the tzdata package installation.
参数
- -d _DIRECTORY_
- Output directory for compiled TZif files (default: system timezone directory).
- -l _timezone_
- Use the given timezone as the local time, creating a localtime link.
- -p _timezone_
- Use timezone's rules for POSIX-style TZ strings that lack transition rules.
- -L _leapsecondfile_
- Read leap second information from the specified file.
- -v
- Report warnings about the input data, including years outside the representable range.
- -b _(slim|fat)_
- Output backward-compatibility data. "fat" generates extra entries for older software. "slim" keeps files small (default).
- -r _@lo/@hi_
- Limit output to timestamps in the given range.
- -D
- Do not create ancestor directories of output files.
- -m _mode_
- Set file permissions on created TZif files.
- --version
- Output version information and exit.
FAQ
What is the zic command used for?
zic is the timezone compiler. It reads text files describing timezone rules (zone names, UTC offsets, daylight saving transitions) and produces binary TZif (Time Zone Information Format) files used by the C library's localtime() and related functions. Input files use a specific format with Rule, Zone, and Link lines that define timezone transitions. The compiled binary files are typically installed in /usr/share/zoneinfo/. The zic compiler is normally run as part of the tzdata package installation.
How do I run a basic zic example?
Run `zic [path/to/tzdata_file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -d _DIRECTORY_ do in zic?
Output directory for compiled TZif files (default: system timezone directory).