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 360_day, 365_day, Julian, Proleptic Gregorian calendars #756

Closed
adrfantini opened this issue Mar 8, 2019 · 4 comments
Closed

Comments

@adrfantini
Copy link

adrfantini commented Mar 8, 2019

Climate models often use different calendars from the one we are used to. Other than the standard R calendar, 360_day, 365_day and 366_day calendars are quite common. The CF-Conventions, which form the basis for the sharing of climate data in the netCDF format, specify the following calendars as possible:

  • gregorian or standard
    Mixed Gregorian/Julian calendar as defined by Udunits. This is the default.
  • proleptic_gregorian
    A Gregorian calendar extended to dates before 1582-10-15. That is, a year is a leap year if either (i) it is divisible by 4 but not by 100 or (ii) it is divisible by 400.
  • noleap or 365_day
    Gregorian calendar without leap years, i.e., all years are 365 days long.
  • all_leap or 366_day
    Gregorian calendar with every year being a leap year, i.e., all years are 366 days long.
  • 360_day
    All years are 360 days divided into 30 day months.
  • julian
    Julian calendar.

In R, support for these calendars is limited but not non existent: the package PCICt includes support and basic arithmetic for these calendars. Would it be possible somehow to include lubridate support for PCICt calendars or objects?

@vspinu
Copy link
Member

vspinu commented Mar 10, 2019

This is quite out of scope of lubridate. Concretely, what kind of support do you have in mind?

@adrfantini
Copy link
Author

adrfantini commented Mar 10, 2019

I was hoping from #151 that PCICt support could be included, but of course that was a long time ago and priorities might have changed.

what kind of support do you have in mind?

Being able to use lubridate tools with PCICt objects would be cool. With that I mean intervals, time zones management, handy functions like months, days...

@romoxml
Copy link

romoxml commented Jun 21, 2019

I concur with the OP. It would be incredibly helpful to be able to run a function similar to:

seq.Date(1,500,by="month",cal.format="360_day")

Currently there is not a clean function for creating accurate date sequences with different calendar formats.

@hadley
Copy link
Member

hadley commented Nov 19, 2019

This is out of scope for lubridate, but would be a great idea for a new package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants