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

Suggestions for additional features #1

Open
zemingyu opened this issue May 30, 2018 · 2 comments
Open

Suggestions for additional features #1

zemingyu opened this issue May 30, 2018 · 2 comments

Comments

@zemingyu
Copy link

SAS has a comprehensive list of date time functions which you can find here:
http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_intervals_sect014.htm

Some of the most commonly used features are:

  • work out the number of week/months/quarter... between two dates. This can be done on a continuous basis or on a discrete basis. (SAS intck() function)

For the DISCRETE method, the distance in MONTHS between January 31, 2000, and February 1, 2000, is one month. The CONTINUOUS (or CONT or C) method uses continuous time intervals. For the CONTINUOUS method, the distance in MONTHS between January 15, 2000, and February 14, 2000, is zero, but the distance in MONTHS between January 15, 2000, and February 15, 2000, is one month.

  • take any date and find the month end/quarter end/year end, or 1st day of the month/quarter/year. The year can be specified to be a financial year ending any month e.g. 31 Mar, 60 Jun, 31 Dec (SAS intnx() function)

  • convert to/from a wide range of date time formats. See the two big tables here: https://v8doc.sas.com/sashtml/lrcon/zenid-63.htm

Some other features that might be useful are

  • public holiday/ school holiday lookup (this varies by location)

If you think these features are useful I can help building some of them.

@bokkypoobah
Copy link
Owner

I would like this first version to be simple and small to deploy. Once it has been used, we can improve on it. Regarding holidays, this is very region dependent and should be a separate library built on top of this lower level functions.

@mvanmeerbeck
Copy link

mvanmeerbeck commented Mar 8, 2019

I would love to be able to add or sub intervals following ISO8601 durations
https://en.wikipedia.org/wiki/ISO_8601#Durations

Here one PHP example http://php.net/manual/fr/class.dateinterval.php
<?php $date = new DateTime('2000-01-01'); $date->add(new DateInterval('P10D')); ?>

Great job !

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

3 participants