I'm reading a json from my local transport company. It contains the dep./arrival times in rfc3339 format. Converting them to my local time zone in PS on Windows works like expected, doing the same on PS on Alpine Linux Container (w. correct time zone set) results in different output. Feeling is that during conversion from json the final Z gets lost so get-date sees the time as being already in local time, but why?
Demo code to show the effect:
$hashtable = @{}
$hashtable.add( "departure", "2023-01-27T20:51:00Z")
get-date($hashtable.departure) -Format "HH:mm"
$json = $hashtable|ConvertTo-Json
$json2 = $json|ConvertFrom-Json
get-date($json2.departure) -Format "HH:mm")
On Windows: 21:51 21:51
On Alpine Linux: 21:51 20:51