|
SdFat
|
#include <stdint.h>
Macros | |
| #define | EPOCH_YEAR 1970 |
| #define | USE_1901_2099 1 |
Functions | |
| uint8_t | dayOfWeek (uint16_t Y, uint8_t M, uint8_t D) |
| uint16_t | dayOfYear (uint16_t Y, uint8_t M, uint8_t D) |
| uint8_t | dayOfYearToDay (uint16_t doy, uint16_t Y, uint8_t M) |
| uint8_t | dayOfYearToMonth (uint16_t doy, uint16_t Y) |
| uint16_t | daysBeforeMonth (uint16_t Y, uint8_t M) |
| uint8_t | daysInMonth (uint16_t Y, uint8_t M) |
| uint16_t | epochDay (uint16_t Y, uint8_t M, uint8_t D) |
| uint8_t | epochDayToDayOfWeek (uint16_t eday) |
| uint16_t | epochDayToYear (uint16_t eday) |
| void | epochDayToYMD (uint16_t eday, uint16_t *Y, uint8_t *M, uint8_t *D) |
| bool | leap (uint16_t Y) |
Copyright (c) 2011-2022 Bill Greiman This file is part of the SdFat library for SD memory cards.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| #define EPOCH_YEAR 1970 |
EPOCH starts on Jan 1 of EPOCH_YEAR.
| #define USE_1901_2099 1 |
Various calendar algorithms. Set USE_1901_2099 nonzero for year in [1901,2099].
|
inline |
Day of week with Sunday == 0.
| [in] | Y | year |
| [in] | M | month 1 <= M <= 12 |
| [in] | D | day 1 <= D <= (last day of month) |
|
inline |
Day of year with Jan1 == 0.
| [in] | Y | year in range supported by leap(). |
| [in] | M | month 0 < M < 13 |
| [in] | D | day 0 < D <= length of month |
|
inline |
Day of year to day
| [in] | doy | day of year 0 <= yday <= 365 |
| [in] | Y | year |
| [in] | M | month 1 <= M <= 12 |
|
inline |
Day of year to month
| [in] | doy | day of year 0 <= yday <= 365 |
| [in] | Y | year |
|
inline |
Number of days in the year before the current month
| [in] | Y | year |
| [in] | M | month 0 < M < 13 |
|
inline |
Number of days in a month.
| [in] | Y | year in range supported by leap(). |
| [in] | M | month 0 < M < 13 |
|
inline |
Count of days since Epoch. 1900 < EPOCH_YEAR, MAX_YEAR < 2100, (MAX_YEAR - EPOCH_YEAR) < 178.
| [in] | Y | year (EPOCH_YEAR <= Y <= MAX_YEAR) |
| [in] | M | month 1 <= M <= 12 |
| [in] | D | day 1 <= D <= 31 |
Derived from Zeller's congruence
|
inline |
epoch day to day of week (Sunday == 0) 1900 < EPOCH_YEAR, MAX_YEAR < 2100, (MAX_YEAR - EPOCH_YEAR) < 178.
| [in] | eday | count of days since epoch. |
|
inline |
Day of epoch to year 1900 < EPOCH_YEAR, MAX_YEAR < 2100, (MAX_YEAR - EPOCH_YEAR) < 178.
| [in] | eday | count of days since epoch |
|
inline |
epoch day to year, month, day 1900 < EPOCH_YEAR, MAX_YEAR < 2100, (MAX_YEAR - EPOCH_YEAR) < 178. Based on "Software, Practice and Experience", Vol. 23 (1993) page 384.
| [in] | eday | count of days since epoch |
| [out] | Y | year |
| [out] | M | month |
| [out] | D | day |
|
inline |
Determine leap year.
| [in] | Y | year |