diff --git a/cmd/headscale/cli/nodes.go b/cmd/headscale/cli/nodes.go index 726b67cd..32ed7bf1 100644 --- a/cmd/headscale/cli/nodes.go +++ b/cmd/headscale/cli/nodes.go @@ -12,7 +12,6 @@ import ( v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/pterm/pterm" "github.com/spf13/cobra" - "github.com/spf13/viper" "google.golang.org/grpc/status" "inet.af/netaddr" "tailscale.com/types/key" @@ -414,8 +413,7 @@ func nodesToPtables( var lastSeen time.Time var lastSeenTime string if machine.LastSeen != nil { - location, _ := time.LoadLocation(viper.GetString("TZ")) - lastSeen = machine.LastSeen.AsTime().In(location) + lastSeen = headscale.TimeFromTZEnv(machine.LastSeen.AsTime()) lastSeenTime = lastSeen.Format("2006-01-02 15:04:05") }