8#ifndef INCLUDED_BDLT_POSIXDATEIMPUTIL
9#define INCLUDED_BDLT_POSIXDATEIMPUTIL
510#include <bdlscm_version.h>
536 static const int s_firstCachedYear;
537 static const int s_lastCachedYear;
538 static const int s_firstCachedSerialDate;
539 static const int s_lastCachedSerialDate;
540 static const int s_cachedSerialDate[][13];
541 static const YearMonthDay s_cachedYearMonthDay[];
542 static const char s_cachedDaysInMonth[][13];
623 static void serialToYd(
int *year,
int *dayOfYear,
int serialDay);
668 static void serialToYmd(
int *year,
int *month,
int *day,
int serialDay);
682 static int ydToDay(
int year,
int dayOfYear);
688 static void ydToMd(
int *month,
int *day,
int year,
int dayOfYear);
693 static int ydToMonth(
int year,
int dayOfYear);
736 && (0 != year % 100 || 0 == year % 400 || year <= 1752);
746 if (month < 1 || month > 12 || day < 1) {
750 if (s_firstCachedYear <= year && year <= s_lastCachedYear) {
751 return day <= s_cachedDaysInMonth[year - s_firstCachedYear][month];
762 return (
static_cast<unsigned>(serialDay) - 1) < 3652061;
784 int year, month, day;
794 int year, month, day;
804 int year, month, day;
822 ydToMd(month, day, *year, dayOfYear);
831 ydToMd(&month, &day, year, dayOfYear);
841 ydToMd(&month, &day, year, dayOfYear);
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bbldc_basicisma30360.h:112
Definition bdlt_posixdateimputil.h:525
static bool isValidSerial(int serialDay)
Definition bdlt_posixdateimputil.h:760
static void serialToYmd(int *year, int *month, int *day, int serialDay)
static void ydToMd(int *month, int *day, int year, int dayOfYear)
static int serialToYear(int serialDay)
static int serialToYearNoCache(int serialDay)
Definition bdlt_posixdateimputil.h:800
static int serialToMonth(int serialDay)
static int ymdToSerial(int year, int month, int day)
static int ymdToDayOfWeek(int year, int month, int day)
Definition bdlt_posixdateimputil.h:856
static bool isValidYearMonthDay(int year, int month, int day)
Definition bdlt_posixdateimputil.h:742
static int serialToDayNoCache(int serialDay)
Definition bdlt_posixdateimputil.h:780
static bool isValidYearMonthDayNoCache(int year, int month, int day)
static bool isValidYearDay(int year, int dayOfYear)
static int ydToDay(int year, int dayOfYear)
Definition bdlt_posixdateimputil.h:826
static int serialToDay(int serialDay)
static void serialToYmdNoCache(int *year, int *month, int *day, int serialDay)
Definition bdlt_posixdateimputil.h:810
static int ydToSerial(int year, int dayOfYear)
static int numLeapYears(int year1, int year2)
static bool isLeapYear(int year)
Definition bdlt_posixdateimputil.h:726
static int serialToMonthNoCache(int serialDay)
Definition bdlt_posixdateimputil.h:790
static int serialToDayOfWeek(int serialDay)
static int ydToMonth(int year, int dayOfYear)
Definition bdlt_posixdateimputil.h:836
static void serialToYd(int *year, int *dayOfYear, int serialDay)
static int serialToDayOfYear(int serialDay)
Definition bdlt_posixdateimputil.h:768
static int ymdToDayOfYear(int year, int month, int day)
static int lastDayOfMonth(int year, int month)
static int ydToDayOfWeek(int year, int dayOfYear)
Definition bdlt_posixdateimputil.h:848
static int ymdToSerialNoCache(int year, int month, int day)