@@ -117,6 +117,10 @@ var pvarNames = []varName{
117
117
"time" ,
118
118
`format used to display time/date column values (default "RFC3339Nano")` ,
119
119
},
120
+ {
121
+ "timezone" ,
122
+ `the timezone to display dates in (default '')` ,
123
+ },
120
124
{
121
125
"title" ,
122
126
"set the table title for subsequently printed tables" ,
@@ -294,6 +298,7 @@ func init() {
294
298
"recordsep_zero" : "off" ,
295
299
"tableattr" : "" ,
296
300
"time" : "RFC3339Nano" ,
301
+ "timezone" : "" ,
297
302
"title" : "" ,
298
303
"tuples_only" : "off" ,
299
304
"unicode_border_linestyle" : "single" ,
@@ -476,7 +481,7 @@ func Ptoggle(name, extra string) (string, error) {
476
481
pvars [name ] = "aligned"
477
482
}
478
483
case "linestyle" :
479
- case "csv_fieldsep" , "fieldsep" , "null" , "recordsep" , "time" , "locale" :
484
+ case "csv_fieldsep" , "fieldsep" , "null" , "recordsep" , "time" , "timezone" , " locale" :
480
485
case "tableattr" , "title" :
481
486
pvars [name ] = ""
482
487
case "unicode_border_linestyle" , "unicode_column_linestyle" , "unicode_header_linestyle" :
@@ -526,6 +531,11 @@ func Pset(name, value string) (string, error) {
526
531
pvars [name ] = value
527
532
case "csv_fieldsep" , "fieldsep" , "null" , "recordsep" , "tableattr" , "time" , "title" , "locale" :
528
533
pvars [name ] = value
534
+ case "timezone" :
535
+ if _ , err := time .LoadLocation (value ); err != nil {
536
+ return "" , text .ErrInvalidTimezoneLocation
537
+ }
538
+ pvars [name ] = value
529
539
case "unicode_border_linestyle" , "unicode_column_linestyle" , "unicode_header_linestyle" :
530
540
if ! borderRE .MatchString (value ) {
531
541
return "" , text .ErrInvalidFormatBorderLineStyle
0 commit comments