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 for ISO 8601 date format #438

Closed
Siskin-Bot opened this issue Feb 15, 2020 · 2 comments
Closed

Support for ISO 8601 date format #438

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

Comments

@Siskin-Bot
Copy link
Collaborator

Siskin-Bot commented Feb 15, 2020

Submitted by: henrikmk

The formats are as follows. Exactly the components shown here must be present, with exactly this punctuation. Note that the "T" appears literally in the string, to indicate the beginning of the time element, as specified in ISO 8601.

Year:
YYYY (eg 1997)
Year and month:
YYYY-MM (eg 1997-07)
Complete date:
YYYY-MM-DD (eg 1997-07-16)
Complete date plus hours and minutes:
YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)
Complete date plus hours, minutes and seconds:
YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
Complete date plus hours, minutes, seconds and a decimal fraction of a second
YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)


Imported from: CureCode [ Version: alpha 31 Type: Wish Platform: All Category: n/a Reproduce: Always Fixed-in:none ]
Imported from: metaeducation#438

Comments:

Rebolbot commented on Jan 20, 2009:

Submitted by: BrianH

Sounds like a job for an addon module of date parsers.


Rebolbot commented on Feb 24, 2013:

Submitted by: Ladislav

Henrik Hmm, the "YYYY" format conflicts with Rebol integers, any idea what to do?


Rebolbot commented on Feb 24, 2013:

Submitted by: Ladislav

Henrik Also, the "YYYY-MM" format may be problematic - I am not sure how it shall be represented "internally" - shall it be represented as the first day of the respective month?


Rebolbot commented on Feb 24, 2013:

Submitted by: Ladislav

My idea how to resolve this in a partially satisfactory way is to define a function like LOAD-ISO-8601 (or LOAD-IDATE better names, anyone?) working, e.g., as follows:

load-iso-8601 "1997" ; == 1/1/1997
load-iso-8601 "1997-02" ; == 1/2/1997

, etc.


Rebolbot commented on Feb 24, 2013:

Submitted by: rgchris

RFC 3339 http://www.ietf.org/rfc/rfc3339.txt is a subset of ISO 8601 defined specifically for Internet timestamps. Current Rebol dates allowing "T" to separate dates and "Z" as a UTC zone marker would be consistent with this format.

"YYYY-MM-DDTHH:MM:SS(.SSS)Z"

Rebolbot commented on Feb 24, 2013:

Submitted by: BrianH

Don't require anyone to remember an ISO number to figure out which function to use. When I implemented the Excel-compatible variant of the formatter for this in my CSV tools script (T is space, Z not supported), I called it TO-ISO-DATE, though that would be a better name for this function (which might benefit from an /excel option for its defacto standard syntax variant). Or maybe FORM-ISO-DATE because it is a formatting function, not a type conversion, though we have other examples which break that pattern. LOAD-ISO-DATE would be the corresponding loader, which should autodetect Excel dates too.


Rebolbot commented on Mar 1, 2013:

Submitted by: DideC

Javascript has Date.toISOString() to form the date with T and Z. Yes I know, it's not an argument.
Using ISO in the name would sounds good as it is already used in other languages.


Rebolbot commented on Mar 1, 2013:

Submitted by: rgchris

Should only need one function to format dates - either a strftime compatible function (like http://www.rebol.org/view-script.r?script=form-date.r or something based on 'reword) or a dialect. The tricky part is identifying dates in source/text.


Rebolbot commented on Feb 19, 2014:

Submitted by: BrianH

Requested again in #2092.


Rebolbot mentioned this issue on Jan 12, 2016:
to-date to accept "internet" format date strings
Support ISO 8601


Rebolbot added the Type.wish on Jan 12, 2016


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


@Siskin-Bot Siskin-Bot added Oldes.resolved Bugs/wishes with Oldes' fixes/features Type.wish labels Feb 15, 2020
@Oldes Oldes closed this as completed Mar 2, 2020
@henrik
Copy link

henrik commented Mar 2, 2020 via email

@Oldes
Copy link
Owner

Oldes commented Mar 3, 2020

@henrik sorry... the content was imported from different issue tracker with its own context... I removed link to you now.

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

3 participants