-
Notifications
You must be signed in to change notification settings - Fork 499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dates in Horizon response not ISO8601 compliant. #1381
Comments
|
Specifically, the TX Envelope for this TX contains: |
After investigating this problem, I don't think this is a bug but expected behavior (up to some point). There are a couple of mysteries here. Let's start by the first one:
No, Horizon handles time-bounds as epoch values in seconds, however if you paste the value in an online tool like https://www.epochconverter.com/, it will show June 10, 2020. The problem is, those tools take seconds or milliseconds. In this scenario, they are handling the value as if it were milliseconds but in reality they are seconds and the value is a date, far, far, far away in the future. We might not even exist by then (but that's a different conversation). The culprit here was probably someone submitting a transaction which was built in JS and they forgot to divide by 1000, epoch in JS land is in milliseconds. See the XDR in the Stellar laboratory The second mystery is:
I think an important distinction to make here is that we are not really returning a ISO8601 string but rather a RFC3339 string, which is an extension of ISO8601, as such, it has some slightly deviations from ISO8601, the most important for this case is that they assume all dates to be in the current era:
This becomes clear by looking at the ABNF:
Horizon hasn't agreed to handle years with more than 4 digits, hence we don't use the
I didn't look at the My assumption here is that they are doing it because they can. We are storing the value as an Int64, which let us represent epoch until We can close this issue, but I'd like to leave the following questions:
|
Ah, the famous Y10K bug! IMHO: 1) we should clarify RFC3339 and 2) we should be strict, since the provided timebounds were probably not what was intended. |
Let's make clear that we are returning an RFC3339 date-time and not ISO8601. There are some deviations between both formats, specifically, RFC3339 expects the years to be in the current era. See stellar#1381 for more info.
I'm assuming here that dates returned by Horizon should meet ISO8601.
This transaction contains a value for the year which does not meet the standard.
The text was updated successfully, but these errors were encountered: