Calendar Units / Date Types (e.g. Year, Month) #105

Closed
Stiivi opened this Issue Feb 23, 2014 · 8 comments

Projects

None yet

6 participants

@Stiivi
Stiivi commented Feb 23, 2014 edited

This issue is now about adding the following two types (or formats of the date type) to JTS:

  • gYear: YYYY
  • gYearMonth: YYYY-MM

Original Description from @Stiivi 2014-02-23

Based on discussion in the Calendar fields (date/time) and the suggestion by @rgrp, the standard should contain a recommendation (not yet strict specification) for some calendar units:

  • iso-year – the field SHOULD be an integer and represents a calendar year as in the ISO date format
  • iso-year-month – the field SHOULD be a string in ISO date format "YYYY-MM" representing a month in a year with unspecified day
  • iso-weekday – the field SHOULD be an integer or a string convertible to integer that represents ISO week day number (0 = monday)

The units should be added to the unit list.

Unresolved questions:

  • Should the ISO week date belong to the unit metadata or some other metadata?
  • What about compact date format YYYYMMYY as common key in the date dimension in data warehouses?
@pwalsh
Member
pwalsh commented Jul 12, 2016

@rgrp @akariv @roll

What do you think about this? AFAIK, in OpenSpending right now we use an integer type for years, for example. this would be more explicit

@akariv
akariv commented Jul 12, 2016

I'm +1 for the suggestion.

@roll roll added the backlog label Aug 8, 2016
@rufuspollock
Contributor

I just made a similar comment in #260 - i note that in the xsd spec you have gYear, gYearMonth.

@rufuspollock rufuspollock changed the title from Calendar Units to Calendar Units / Date Types (e.g. Year, Month) Aug 9, 2016
@rufuspollock
Contributor

Updated this issue description to be specifically about gYear and gYearMonth

@roll roll removed the backlog label Aug 29, 2016
@rufuspollock rufuspollock added this to the Current milestone Sep 27, 2016
@jpmckinney
Member

I don't consider 'year-month' a unit. It's a date format. I prefer either adding named format values or using pattern/formatString as described in #260.

@Stiivi
Stiivi commented Sep 27, 2016 edited

@jpmckinney year-month is a very common analytical concept as is uniquely specifies point on a date/time dimension at a month level of the year-month-* hierarchy (as opposed to say year-quarter-month-* hierarchy). It is also used as key-forming unit on derived aggregates at the given level. In this case it is very different from just being a format.

EDIT: Added example of alternative hierarchy.

@jpmckinney
Member

@Stiivi All the current units are real units of measurement. The units of measurement for time are seconds, minutes, etc. but not with respect to any particular anchor.

YYYY and YYYY-MM only make sense given the anchor of 0 at roughly 2016 revolutions of the Earth around the Sun ago. They are not units, at least not in the same sense as the others.

@jpmckinney jpmckinney modified the milestone: Blockers, Current Sep 28, 2016
@jpmckinney jpmckinney added the blocker label Sep 28, 2016
@roll roll removed the blocker label Nov 16, 2016
@rufuspollock
Contributor

FIXED. Implemented gYear and gYearMonth following xmlschema-2

@rufuspollock rufuspollock added a commit that referenced this issue Nov 30, 2016
@rufuspollock rufuspollock [jts][s]: lowercase gYear and gYearMonth - fixes #320 refs #105.
Why: consistency - all of our types are lowercase (e.g. datetime).

Follow up to last commit here 01aa7b6.
4e68bbe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment