I was trying to retrieve a report in a Bitbucket instance. The return from the API contains event dates. However, the value looks strange. It is something like 1680143775227
.
The format looks like Unix Epoch Timestamp. But it was converted to a far future time in any online converters.
The .Net action [System.DateTime]::UnixEpoch.AddSeconds()
threw an error:
MethodInvocationException: Exception calling "AddSeconds" with "1" argument(s): "Value to add was out of range. (Parameter 'value')"
The solution is using [System.DateTime]::UnixEpoch.AddMilliSeconds()
to convert the time.
Such format calls Epoch Milliseconds or Unix Time in Milliseconds.