Skip to content

Commit 04aa53c

Browse files
committed
fetching date culture independent, resolves #2
1 parent 2ad13d7 commit 04aa53c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

watchdog.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function Test-RportState {
5555
Write-Message "ERROR: Statefile $($stateFile) not found. Not cheching."
5656
return
5757
}
58-
$now = ((Get-Date -UFormat %s) - [int](Get-Date -UFormat %Z) * 3600)
58+
$now = [DateTimeOffset]::Now.ToUnixTimeSeconds()
5959
$lastUpdate = (Get-Content $stateFile | ConvertFrom-Json).last_update_ts
6060
$diff = $now - $lastUpdate
6161
if ($diff -gt $Threshold) {

0 commit comments

Comments
 (0)