|
| 1 | +NAME |
| 2 | + |
| 3 | + zic - time zone compiler |
| 4 | + |
| 5 | +SYNOPSIS |
| 6 | + zic [ --version ] [ -v ] [ -d directory ] [ -l localtime ] [ |
| 7 | + -p posixrules ] [ -L leapsecondfilename ] [ -s ] [ -y |
| 8 | + command ] [ filename ... ] |
| 9 | + |
| 10 | +DESCRIPTION |
| 11 | + Zic reads text from the file(s) named on the command line |
| 12 | + and creates the time conversion information files specified |
| 13 | + in this input. If a filename is -, the standard input is |
| 14 | + read. |
| 15 | + |
| 16 | + These options are available: |
| 17 | + |
| 18 | + --version |
| 19 | + Output version information and exit. |
| 20 | + |
| 21 | + -d directory |
| 22 | + Create time conversion information files in the named |
| 23 | + directory rather than in the standard directory named |
| 24 | + below. |
| 25 | + |
| 26 | + -l timezone |
| 27 | + Use the given time zone as local time. Zic will act as |
| 28 | + if the input contained a link line of the form |
| 29 | + |
| 30 | + Link timezone localtime |
| 31 | + |
| 32 | + -p timezone |
| 33 | + Use the given time zone's rules when handling POSIX- |
| 34 | + format time zone environment variables. Zic will act |
| 35 | + as if the input contained a link line of the form |
| 36 | + |
| 37 | + Link timezone posixrules |
| 38 | + |
| 39 | + -L leapsecondfilename |
| 40 | + Read leap second information from the file with the |
| 41 | + given name. If this option is not used, no leap second |
| 42 | + information appears in output files. |
| 43 | + |
| 44 | + -v Complain if a year that appears in a data file is |
| 45 | + outside the range of years representable by time(2) |
| 46 | + values. Also complain if a time of 24:00 (which cannot |
| 47 | + be handled by pre-1998 versions of zic) appears in the |
| 48 | + input. |
| 49 | + |
| 50 | + -s Limit time values stored in output files to values that |
| 51 | + are the same whether they're taken to be signed or |
| 52 | + unsigned. You can use this option to generate SVVS- |
| 53 | + compatible files. |
| 54 | + |
| 55 | + -y command |
| 56 | + Use the given command rather than yearistype when |
| 57 | + checking year types (see below). |
| 58 | + |
| 59 | + Input lines are made up of fields. Fields are separated |
| 60 | + from one another by any number of white space characters. |
| 61 | + Leading and trailing white space on input lines is ignored. |
| 62 | + An unquoted sharp character (#) in the input introduces a |
| 63 | + comment which extends to the end of the line the sharp |
| 64 | + character appears on. White space characters and sharp |
| 65 | + characters may be enclosed in double quotes (") if they're |
| 66 | + to be used as part of a field. Any line that is blank |
| 67 | + (after comment stripping) is ignored. Non-blank lines are |
| 68 | + expected to be of one of three types: rule lines, zone |
| 69 | + lines, and link lines. |
| 70 | + |
| 71 | + A rule line has the form |
| 72 | + |
| 73 | + Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S |
| 74 | + |
| 75 | + For example: |
| 76 | + |
| 77 | + Rule US 1967 1973 - Apr lastSun 2:00 1:00 D |
| 78 | + |
| 79 | + The fields that make up a rule line are: |
| 80 | + |
| 81 | + NAME Gives the (arbitrary) name of the set of rules this |
| 82 | + rule is part of. |
| 83 | + |
| 84 | + FROM Gives the first year in which the rule applies. Any |
| 85 | + integer year can be supplied; the Gregorian calendar |
| 86 | + is assumed. The word minimum (or an abbreviation) |
| 87 | + means the minimum year representable as an integer. |
| 88 | + The word maximum (or an abbreviation) means the |
| 89 | + maximum year representable as an integer. Rules can |
| 90 | + describe times that are not representable as time |
| 91 | + values, with the unrepresentable times ignored; this |
| 92 | + allows rules to be portable among hosts with |
| 93 | + differing time value types. |
| 94 | + |
| 95 | + TO Gives the final year in which the rule applies. In |
| 96 | + addition to minimum and maximum (as above), the word |
| 97 | + only (or an abbreviation) may be used to repeat the |
| 98 | + value of the FROM field. |
| 99 | + |
| 100 | + TYPE Gives the type of year in which the rule applies. |
| 101 | + If TYPE is - then the rule applies in all years |
| 102 | + between FROM and TO inclusive. If TYPE is something |
| 103 | + else, then zic executes the command |
| 104 | + yearistype year type |
| 105 | + to check the type of a year: an exit status of zero |
| 106 | + is taken to mean that the year is of the given type; |
| 107 | + an exit status of one is taken to mean that the year |
| 108 | + is not of the given type. |
| 109 | + |
| 110 | + IN Names the month in which the rule takes effect. |
| 111 | + Month names may be abbreviated. |
| 112 | + |
| 113 | + ON Gives the day on which the rule takes effect. |
| 114 | + Recognized forms include: |
| 115 | + |
| 116 | + 5 the fifth of the month |
| 117 | + lastSun the last Sunday in the month |
| 118 | + lastMon the last Monday in the month |
| 119 | + Sun>=8 first Sunday on or after the eighth |
| 120 | + Sun<=25 last Sunday on or before the 25th |
| 121 | + |
| 122 | + Names of days of the week may be abbreviated or |
| 123 | + spelled out in full. Note that there must be no |
| 124 | + spaces within the ON field. |
| 125 | + AT Gives the time of day at which the rule takes |
| 126 | + effect. Recognized forms include: |
| 127 | + |
| 128 | + 2 time in hours |
| 129 | + 2:00 time in hours and minutes |
| 130 | + 15:00 24-hour format time (for times after noon) |
| 131 | + 1:28:14 time in hours, minutes, and seconds |
| 132 | + - equivalent to 0 |
| 133 | + |
| 134 | + where hour 0 is midnight at the start of the day, |
| 135 | + and hour 24 is midnight at the end of the day. Any |
| 136 | + of these forms may be followed by the letter w if |
| 137 | + the given time is local "wall clock" time, s if the |
| 138 | + given time is local "standard" time, or u (or g or |
| 139 | + z) if the given time is universal time; in the |
| 140 | + absence of an indicator, wall clock time is assumed. |
| 141 | + |
| 142 | + SAVE Gives the amount of time to be added to local |
| 143 | + standard time when the rule is in effect. This |
| 144 | + field has the same format as the AT field (although, |
| 145 | + of course, the w and s suffixes are not used). |
| 146 | + |
| 147 | + LETTER/S |
| 148 | + Gives the "variable part" (for example, the "S" or |
| 149 | + "D" in "EST" or "EDT") of time zone abbreviations to |
| 150 | + be used when this rule is in effect. If this field |
| 151 | + is -, the variable part is null. |
| 152 | + |
| 153 | + A zone line has the form |
| 154 | + |
| 155 | + Zone NAME GMTOFF RULES/SAVE FORMAT [UNTILYEAR [MONTH [DAY [TIME]]]] |
| 156 | + |
| 157 | + For example: |
| 158 | + |
| 159 | + Zone Australia/Adelaide 9:30 Aus CST 1971 Oct 31 2:00 |
| 160 | + |
| 161 | + The fields that make up a zone line are: |
| 162 | + |
| 163 | + NAME The name of the time zone. This is the name used in |
| 164 | + creating the time conversion information file for the |
| 165 | + zone. |
| 166 | + |
| 167 | + GMTOFF |
| 168 | + The amount of time to add to UTC to get standard time |
| 169 | + in this zone. This field has the same format as the |
| 170 | + AT and SAVE fields of rule lines; begin the field with |
| 171 | + a minus sign if time must be subtracted from UTC. |
| 172 | + |
| 173 | + RULES/SAVE |
| 174 | + The name of the rule(s) that apply in the time zone |
| 175 | + or, alternately, an amount of time to add to local |
| 176 | + standard time. If this field is - then standard time |
| 177 | + always applies in the time zone. |
| 178 | + |
| 179 | + FORMAT |
| 180 | + The format for time zone abbreviations in this time |
| 181 | + zone. The pair of characters %s is used to show where |
| 182 | + the "variable part" of the time zone abbreviation |
| 183 | + goes. Alternately, a slash (/) separates standard and |
| 184 | + daylight abbreviations. |
| 185 | + |
| 186 | + UNTILYEAR [MONTH [DAY [TIME]]] |
| 187 | + The time at which the UTC offset or the rule(s) change |
| 188 | + for a location. It is specified as a year, a month, a |
| 189 | + day, and a time of day. If this is specified, the |
| 190 | + time zone information is generated from the given UTC |
| 191 | + offset and rule change until the time specified. The |
| 192 | + month, day, and time of day have the same format as |
| 193 | + the IN, ON, and AT fields of a rule; trailing fields |
| 194 | + can be omitted, and default to the earliest possible |
| 195 | + value for the missing fields. |
| 196 | + |
| 197 | + The next line must be a "continuation" line; this has |
| 198 | + the same form as a zone line except that the string |
| 199 | + "Zone" and the name are omitted, as the continuation |
| 200 | + line will place information starting at the time |
| 201 | + specified as the "until" information in the previous |
| 202 | + line in the file used by the previous line. |
| 203 | + Continuation lines may contain "until" information, |
| 204 | + just as zone lines do, indicating that the next line |
| 205 | + is a further continuation. |
| 206 | + |
| 207 | + A link line has the form |
| 208 | + |
| 209 | + Link LINK-FROM LINK-TO |
| 210 | + |
| 211 | + For example: |
| 212 | + |
| 213 | + Link Europe/Istanbul Asia/Istanbul |
| 214 | + |
| 215 | + The LINK-FROM field should appear as the NAME field in some |
| 216 | + zone line; the LINK-TO field is used as an alternate name |
| 217 | + for that zone. |
| 218 | + |
| 219 | + Except for continuation lines, lines may appear in any order |
| 220 | + in the input. |
| 221 | + |
| 222 | + Lines in the file that describes leap seconds have the |
| 223 | + following form: |
| 224 | + |
| 225 | + Leap YEAR MONTH DAY HH:MM:SS CORR R/S |
| 226 | + |
| 227 | + For example: |
| 228 | + |
| 229 | + Leap 1974 Dec 31 23:59:60 + S |
| 230 | + |
| 231 | + The YEAR, MONTH, DAY, and HH:MM:SS fields tell when the leap |
| 232 | + second happened. The CORR field should be "+" if a second |
| 233 | + was added or "-" if a second was skipped. The R/S field |
| 234 | + should be (an abbreviation of) "Stationary" if the leap |
| 235 | + second time given by the other fields should be interpreted |
| 236 | + as UTC or (an abbreviation of) "Rolling" if the leap second |
| 237 | + time given by the other fields should be interpreted as |
| 238 | + local wall clock time. |
| 239 | + |
| 240 | +EXTENDED EXAMPLE |
| 241 | + Here is an extended example of zic input, intended to |
| 242 | + illustrate many of its features. |
| 243 | + |
| 244 | + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S |
| 245 | + Rule Swiss 1940 only - Nov 2 0:00 1:00 S |
| 246 | + Rule Swiss 1940 only - Dec 31 0:00 0 - |
| 247 | + Rule Swiss 1941 1942 - May Sun>=1 2:00 1:00 S |
| 248 | + Rule Swiss 1941 1942 - Oct Sun>=1 0:00 0 |
| 249 | + Rule EU 1977 1980 - Apr Sun>=1 1:00u 1:00 S |
| 250 | + Rule EU 1977 only - Sep lastSun 1:00u 0 - |
| 251 | + Rule EU 1978 only - Oct 1 1:00u 0 - |
| 252 | + Rule EU 1979 1995 - Sep lastSun 1:00u 0 - |
| 253 | + Rule EU 1981 max - Mar lastSun 1:00u 1:00 S |
| 254 | + Rule EU 1996 max - Oct lastSun 1:00u 0 - |
| 255 | + |
| 256 | + # Zone NAME GMTOFF RULES FORMAT UNTIL |
| 257 | + Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12 |
| 258 | + 0:29:44 - BMT 1894 Jun |
| 259 | + 1:00 Swiss CE%sT 1981 |
| 260 | + 1:00 EU CE%sT |
| 261 | + |
| 262 | + Link Europe/Zurich Switzerland |
| 263 | + |
| 264 | + In this example, the zone is named Europe/Zurich but it has |
| 265 | + an alias as Switzerland. Zurich was 34 minutes and 8 |
| 266 | + seconds west of GMT until 1848-09-12 at 00:00, when the |
| 267 | + offset changed to 29 minutes and 44 seconds. After |
| 268 | + 1894-06-01 at 00:00 Swiss daylight saving rules (defined |
| 269 | + with lines beginning with "Rule Swiss") apply, and the GMT |
| 270 | + offset became one hour. From 1981 to the present, EU |
| 271 | + daylight saving rules have applied, and the UTC offset has |
| 272 | + remained at one hour. |
| 273 | + |
| 274 | + In 1940, daylight saving time applied from November 2 at |
| 275 | + 00:00 to December 31 at 00:00. In 1941 and 1942, daylight |
| 276 | + saving time applied from the first Sunday in May at 02:00 to |
| 277 | + the first Sunday in October at 00:00. The pre-1981 EU |
| 278 | + daylight-saving rules have no effect here, but are included |
| 279 | + for completeness. Since 1981, daylight saving has begun on |
| 280 | + the last Sunday in March at 01:00 UTC. Until 1995 it ended |
| 281 | + the last Sunday in September at 01:00 UTC, but this changed |
| 282 | + to the last Sunday in October starting in 1996. |
| 283 | + |
| 284 | + For purposes of display, "LMT" and "BMT" were initially |
| 285 | + used, respectively. Since Swiss rules and later EU rules |
| 286 | + were applied, the display name for the timezone has been CET |
| 287 | + for standard time and CEST for daylight saving time. |
| 288 | + |
| 289 | +NOTES |
| 290 | + For areas with more than two types of local time, you may |
| 291 | + need to use local standard time in the AT field of the |
| 292 | + earliest transition time's rule to ensure that the earliest |
| 293 | + transition time recorded in the compiled file is correct. |
| 294 | + |
| 295 | + If, for a particular zone, a clock advance caused by the |
| 296 | + start of daylight saving coincides with and is equal to a |
| 297 | + clock retreat caused by a change in UTC offset, zic produces |
| 298 | + a single transition to daylight saving at the new UTC offset |
| 299 | + (without any change in wall clock time). To get separate |
| 300 | + transitions use multiple zone continuation lines specifying |
| 301 | + transition instants using universal time. |
| 302 | + |
| 303 | +FILE |
| 304 | + /usr/local/etc/zoneinfo standard directory used for |
| 305 | + created files |
| 306 | + |
| 307 | +SEE ALSO |
| 308 | + newctime(3), tzfile(5), zdump(8) |
0 commit comments