You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cast age currently produces a timestamp in human-readable format that does not carry a timezone indication. This is ambiguous because it is implicitly in the UTC timezone, but other tools might assume that it is in a contextual local timezone. This can lead users to compute incorrect values — e.g. block timestamps that are off by one or more hour — in normal usage and can be very hard to debug. It would suffice to add " UTC" to the output to resolve this ambiguity.
Additional context
Say you want to compute the timestamp of the block at which that the merge happened on Mainnet on a Linux machine. You could combine Foundry with the standard date command to obtain that information. However, if your timezone is different than UTC (here Europe/Zurich), the naive command combination below will give an incorrect result. The two alternatives that follow give the correct result
$ date +%s -d "`cast age 15537394`" # incorrect result
1663216979
$ date +%s -d "`cast age 15537394` UTC" # simulating foundry-side fix
1663224179
$ date +%s -ud "`cast age 15537394`" # ad-hoc fix
1663224179
The text was updated successfully, but these errors were encountered:
Component
Cast
Describe the feature you would like
cast age
currently produces a timestamp in human-readable format that does not carry a timezone indication. This is ambiguous because it is implicitly in the UTC timezone, but other tools might assume that it is in a contextual local timezone. This can lead users to compute incorrect values — e.g. block timestamps that are off by one or more hour — in normal usage and can be very hard to debug. It would suffice to add" UTC"
to the output to resolve this ambiguity.Additional context
Say you want to compute the timestamp of the block at which that the merge happened on Mainnet on a Linux machine. You could combine Foundry with the standard date command to obtain that information. However, if your timezone is different than UTC (here
Europe/Zurich
), the naive command combination below will give an incorrect result. The two alternatives that follow give the correct resultThe text was updated successfully, but these errors were encountered: