File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ Australia/Sydney 2023-12-11 08:39:43 +1100
24
24
for ≈ ` 600 ` entries.
25
25
- 🔒 _ ** Robust** _ - tested to work with all [ tz database] entries,
26
26
` version 2023c ` .
27
- - 📦 ** Self-contained** - zero dependencies, lighweight, ISO C99,
28
- ( ` 2676 bytes` , ` 140 lines ` ).
27
+ - 📦 ** Self-contained** - zero dependencies, ISO C99, lighweight (`2676
28
+ bytes` , ` 140 lines`).
29
29
30
30
## Getting Started
31
31
@@ -65,10 +65,17 @@ Files:
65
65
Stores valid tz database identifiers to be displayed by twc.
66
66
67
67
Examples:
68
+ $ twc -h -s %Y-%m-%d -t Japan/Tokyo
69
+ 2023-12-11
68
70
71
+ $ TZ=America/Los_Angeles twz
72
+ 2023-12-11T04:25:37-0800
73
+
74
+ Environment:
75
+ TZ Timezone to use when displaying dates. See environ(7).
69
76
70
77
See also:
71
- time(3), strftime(3)
78
+ time(3), strftime(3), environ(7)
72
79
```
73
80
74
81
## Compatibility
Original file line number Diff line number Diff line change @@ -114,6 +114,11 @@ int main(int argc, char **argv) {
114
114
115
115
timefmt = time_fmts [TIMEFMT_ISO ];
116
116
117
+ const char * tz_env = getenv ("TZ" );
118
+ if (tz_env ) {
119
+ fmt = tz_env ;
120
+ }
121
+
117
122
while ((opt = getopt (argc , argv , "hf:s:t:" )) != -1 ) {
118
123
switch (opt ) {
119
124
case 'h' :
You can’t perform that action at this time.
0 commit comments