@@ -64,6 +64,7 @@ type Application struct {
6464 NoLogColors bool // Disable log colors
6565 LogLevel string // Idicate the log level
6666 Debug bool // Enable the debug mode
67+ TimeZone string // Override default TZ
6768
6869 Immich * immich.ImmichClient // Immich client
6970 Logger * logger.Log // Program's logger
@@ -78,10 +79,6 @@ func Run(ctx context.Context, log *logger.Log) (*logger.Log, error) {
7879 if err != nil {
7980 return log , err
8081 }
81- _ , err = tzone .Local ()
82- if err != nil {
83- return log , err
84- }
8582
8683 app := Application {}
8784 flag .StringVar (& app .Server , "server" , "" , "Immich server address (http://<your-ip>:2283 or https://<your-domain>)" )
@@ -93,8 +90,14 @@ func Run(ctx context.Context, log *logger.Log) (*logger.Log, error) {
9390 flag .StringVar (& app .LogFile , "log-file" , "" , "Write log messages into the file" )
9491 flag .BoolVar (& app .ApiTrace , "api-trace" , false , "enable api call traces" )
9592 flag .BoolVar (& app .Debug , "debug" , false , "enable debug messages" )
93+ flag .StringVar (& app .TimeZone , "time-zone" , "" , "Override the system time zone" )
9694 flag .Parse ()
9795
96+ _ , err = tzone .SetLocal (app .TimeZone )
97+ if err != nil {
98+ return log , err
99+ }
100+
98101 if len (app .LogFile ) > 0 {
99102 flog , err := os .Create (app .LogFile )
100103 if err != nil {
0 commit comments