-
Notifications
You must be signed in to change notification settings - Fork 94
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
Use ISO standard date-time formats #119
Comments
Would this eventual change be quite disruptive? Perhaps it would be desirable for cylc to write cycle time in the YYYYmmddTHH format sooner rather than later? |
Matt, unfortunately I haven't had a chance to think about this yet, or even read the ISO standard references. Is the notation you've suggested sufficiently general to handle everything we could conceivably want to do with cylc - including cycling for paleo-climate simulations (how are pre-historic dates represented? And, we would need to include minutes too for future NWP suites. Luis @m214089 - do you have any advice on this: i.e. can we quickly convert to a general cycle time notation that will make the future transition to ISO date-time representation easy on users? |
Hi, we currently change our time control in the models to an ISO based scheme. By the way a date looks like Matt wrote as one possible way. Recurrences/event are denoted RyyyyyYmmMddDT...... where everything not used could be missing. I have a shorter than the standard description of the whole thing, but I can provide it to you only after the 15th, because I'm leaving for vacation later today ... If that's fine with you just answer, and I'll provide you with the information by then. Cheerio, |
I think the ISO 8601 format should be sufficient to handle every date time representation we'll need, as it is designed to do so. If it does not do so, we can put the blame on the standard format ;-) In particular, historical dates and 9999+ years can both be represented. (A second thought. I guess this change does not have to be disruptive at all. When the ISO functionality is introduced in Cylc, we can provide a classic mode where YYYYmmddHH will be used, and an ISO mode where the (basic) ISO 8601 format will be used.) |
Hi Matt, |
Luis, that's fine - have a great vacation! On 7/10/2012, at 7:51, m214089 notifications@github.com wrote:
|
@matthewrmshin, I know the ISO standard is meant to cover all bases, I was just asking if the notation you suggested (YYYYmmddTHH) is general (i.e. can that particular notation express all that the standard covers?) It's not obvious that addition of a "T" between date and time helps any (how does that handle pre-historic dates?). Anyhow, that's just to explain better what I was asking above - I should read the standard myself, of course! I agree this need not be a disruptive change, but at the same time if we could easily change to a new ISO-compatible cycle time notation before promised backward compatibility kicks in, maybe we could avoid having to support a distinct "classic mode" in the future. |
@hjoliver The basic notation of the date would match this Pythonic regular expression |
The original standard can be found at: http://dotat.at/tmp/ISO_8601-2004_E.pdf Useful ISO 6801 features from my point of view: Designators
Duration designators
Calendar date
Maybe ordinal date
Representing dates Date Basic Format Extended Format Representing times Time Basic Format Extended Format For universal time (UT) a Z should be required at the end of the time string. Are timezones required? T indicates start of time. Calendar dates + UT time: YYYY-MM-DDThh:mmZ Representing time-intervals P indicates a duration (period). Intervals can come in four different varieties:
it can be ommited, if it is trailing.
Recurring time-intervals R is used to indicate recurrence. Recurring time intervals are expressed by:
If number of recurrences is not provided, then the number is unbounded. For simplicity the implementation is only supporting the second expression for recurring time intervals. Regex definitions/collection Regex for date and time so far constructed:
Regex for duration/time intervall so far constructed:
or
Not sure which one to use yet. The regex are for the full standard including business week, which we do not need. As well I have a set of routines in C for calculating the Julian date to proleptic Gregorian in a pure integer implementation including negative Julian days. The same for pure 360 day years and 365 day years. We would need to convert those to Python. Unfortunately none of the Python date utils is sufficient clean to be used. I would be happy if you could have a look into the regex. They are not trivial ... |
We've riffed on this a bit here - please have a look: |
Nice, well done!! I'll print it out and read it on the plane tomorrow. |
[This discussion temporarily went to #887] |
10-minute cycling #68: |
Very cool |
Could we use the no-seconds, no-delimiters kind of dump format for the date/times? |
Yes. What I've done so far is pretty rough, there will no doubt be some detail to attend to... |
…test #119: fix restart bugs and old-style cycling anchors
…_point #119: rename cycle time to cycle point
#119: accept suite.rc interval configuration in ISO 8601 formats
I'm closing this as our master branch now does "use ISO standard date-time formats". |
This is a completely general notation for specifying date/times and time ranges. It would presumably allow us to replace all the current cycling modules (daily, monthly, etc.) with a single one that could handle any cycle time sequence. And cycling for paleo-climate simulations?
MPI is developing an ISO time library for Python.
The text was updated successfully, but these errors were encountered: