Calendar functions
|
04-01-2017, 10:07 AM
(This post was last modified: 04-02-2017 04:17 PM by JMB.)
Post: #1
|
|||
|
|||
Calendar functions
The input syntax used for dates in these calendar functions that I have coded, is the same used by the HP Prime built-in functions: YYYY.MMDD.
The valid range of dates is also the range used by the HP Prime built-in functions: from 1582.1015 (Julian day 2299161) to 9999.1231 (Julian day 5373484). Most functions have a very short coding, because they take avantatge of the HP Prime functions DAYOFWEEK, DDAYS and DATEADD. Listing [Updated. I corrected a typo found by ggauny@live.fr] PHP Code: // Calendar functions Here are some examples: Is_Date_Valid(2017.0401) → 1 Is_Date_Valid(2017.0229) → 0 Is_Leap_Year(2017.0401) → 0 Is_Leap_Year(2017) → 0 Is_Leap_Year(2016.0401) → 1 Is_Leap_Year(2016) → 1 Century(2017.0401) → 21 Century(2017) → 21 Year(2017.0401) → 2017 Month(2017.0401) → 4 Day(2017.0401) → 1 Date_to_Julian_Day(2017.0401) → 2457845 Julian_Day_to_Date(2457845) → 2017.0401 Week_Number(2017.0401) → 13 |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Calendar functions - JMB - 04-01-2017 10:07 AM
RE: Calendar functions - ggauny@live.fr - 04-01-2017, 02:15 PM
RE: Calendar functions - ggauny@live.fr - 04-02-2017, 08:56 AM
RE: Calendar functions - JMB - 04-02-2017, 10:13 AM
|
User(s) browsing this thread: 1 Guest(s)