Skip to content
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

Support ISO 8601 #2092

Closed
Siskin-Bot opened this issue Feb 15, 2020 · 1 comment
Closed

Support ISO 8601 #2092

Siskin-Bot opened this issue Feb 15, 2020 · 1 comment
Labels
Oldes.resolved Bugs/wishes with Oldes' fixes/features Test.written Type.wish

Comments

@Siskin-Bot
Copy link
Collaborator

Submitted by: Ladislav

I want LOAD to be able to "understand" the examples below, and I want MOLD/ALL (maybe even MOLD) to produce them.

Advantages:

Disadvantages:

  • do not think there are any
2013-11-08T17:01
2013-11-08T17:01+01
2013-11-08T17:01Z

Imported from: CureCode [ Version: r3 master Type: Wish Platform: All Category: Syntax Reproduce: Always Fixed-in:none ]
Imported from: metaeducation#2092

Comments:

Rebolbot commented on Nov 8, 2013:

Submitted by: abolka

I'd also like to see this supported (including formats with seconds and fractional seconds).


Rebolbot commented on Nov 17, 2013:

Submitted by: Gregg

+1 for loading them.

-1 for MOLD creating them.

-0.5 for MOLD/ALL creating them.

One concern is what level of ISO8601 compatibility is implied/supported. I use my own FORMAT and loaders funcs to create and parse them today, which makes it clear.


Rebolbot commented on Nov 19, 2013:

Submitted by: maxim

+1 For me, I don't like the molded notation right now, its not international.

I'd prefer ISO format, it would be much simpler for web and xml manipulation tools.


Rebolbot commented on Nov 19, 2013:

Submitted by: rgchris

I am for this, or at least using RFC3339 as the default representation of time.

http://www.ietf.org/rfc/rfc3339.txt


Rebolbot commented on Feb 17, 2014:

Submitted by: BrianH

Don't support the more obscure formats of ISO8601, just the common, recommended formats that don't conflict with our other datatypes. Hyphens required in dates, colons required in times, no non-numeric time zones except the Z for UTC thing, no 2-digit years, no week dates or ordinal dates, and nothing from the standard that we don't support in the semantics of our date! or time! types. Only support negative years if our semantic model allows them.

We should also make sure TO-DATE allows the variant where a space is used instead of a T, and no Z is included, to be able to handle the most common variant. We wouldn't be able to or need to support that variant in normal LOAD syntax though. We might want TO-DATE to support some of the other semantics-compatible ISO8601 syntaxes, like skipping the hyphens for instance, but we'll see if it's worth it.


Rebolbot commented on Feb 19, 2014:

Submitted by: BrianH

This is a dup of #438.


Rebolbot added the Type.wish on Jan 12, 2016


Ladislav added Type.wish and Status.dismissed on Mar 14, 2016


Oldes commented on Dec 17, 2018:

Red language is able to load iso8601 dates as provided in Ladislav's request:

>> 2013-11-08T17:01
== 8-Nov-2013/17:01:00
>> 2013-11-08T17:01+01
== 8-Nov-2013/17:01:00+01:00
>> 2013-11-08T17:01Z
== 8-Nov-2013/17:01:00

So it would be nice to have it in Rebol too.


Hostilefork commented on Dec 17, 2018:

no "clash" with path syntax (see #2089)

The collision with PATH! syntax is bad (imo), which might support the idea of ISO8601 being the canon date literal. (Though it might clash with URL? :-/)

If pathing a TIME! out of a DATE! gave you a DATETIME! (or an ISO8601! ?) that's not necessarily so bad. For those who would complain that evaluation throws away prettiness, there are much simpler examples like when a WORD! is translated to a LOGIC!, and true becomes #[true]. Decaying a path to a date format is really the same thing, and a less likely one (I deal with logic far more than I ever have to use dates/times)

But it is, to my mind, something where there has to be a clear design point before adding more lexical syntaxes. It's a hodgepodge right now and there aren't clear principles of "when does it stop".


Oldes commented on Dec 17, 2018:

Actually Red has much wider support than above mentioned examples, which I found just by accident. I'm not concerned about Ladislav's clash too much, but I think that mold/all could provide basic ISO output. For me is quite important to be able load datetime from foreign source without need to replace chars in it.


Oldes added a commit to Oldes/Rebol3 that referenced this issue on Dec 17, 2018:
FEAT: enabling T as a delimiter between date and time and Z as a zero…


Oldes added a commit to Oldes/Rebol3 that referenced this issue on Dec 17, 2018:
FEAT: letting MOLD/ALL on datetime value to produce ISO8601 valid result


@Oldes
Copy link
Owner

Oldes commented Mar 2, 2020

>> load "2013-11-08T17:01Z"
== 8-Nov-2013/17:01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Oldes.resolved Bugs/wishes with Oldes' fixes/features Test.written Type.wish
Projects
None yet
Development

No branches or pull requests

2 participants