8#ifndef INCLUDED_BDLT_PROLEPTICDATEIMPUTIL
9#define INCLUDED_BDLT_PROLEPTICDATEIMPUTIL
396#include <bdlscm_version.h>
420 struct YearMonthDay {
427 k_MAX_SERIAL_DATE = 3652059
431 static const int s_firstCachedYear;
432 static const int s_lastCachedYear;
433 static const int s_firstCachedSerialDate;
434 static const int s_lastCachedSerialDate;
435 static const int s_cachedSerialDate[][13];
436 static const YearMonthDay s_cachedYearMonthDay[];
437 static const char s_cachedDaysInMonth[][13];
514 static void serialToYd(
int *year,
int *dayOfYear,
int serialDay);
559 static void serialToYmd(
int *year,
int *month,
int *day,
int serialDay);
573 static int ydToDay(
int year,
int dayOfYear);
579 static void ydToMd(
int *month,
int *day,
int year,
int dayOfYear);
584 static int ydToMonth(
int year,
int dayOfYear);
627 return 0 == year % 4 && (0 != year % 100 || 0 == year % 400);
635 return static_cast<unsigned>(serialDay) - 1 < k_MAX_SERIAL_DATE;
641 if (s_firstCachedYear <= year && year <= s_lastCachedYear) {
644 if (month < 1 || month > 12 || day < 1) {
648 return day <= s_cachedDaysInMonth[year - s_firstCachedYear][month];
675 int year, month, day;
685 int year, month, day;
713 ydToMd(month, day, *year, dayOfYear);
722 ydToMd(&month, &day, year, dayOfYear);
732 ydToMd(&month, &day, year, dayOfYear);
745 return 1 + serialDay % 7;
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_REVIEW(X)
Definition bsls_review.h:949
Definition bbldc_basicisma30360.h:112
Definition bdlt_prolepticdateimputil.h:416
static int numLeapYears(int year1, int year2)
static int serialToDayOfYear(int serialDay)
Definition bdlt_prolepticdateimputil.h:659
static int ydToDayOfWeek(int year, int dayOfYear)
Definition bdlt_prolepticdateimputil.h:749
static bool isValidSerial(int serialDay)
Definition bdlt_prolepticdateimputil.h:633
static int ymdToDayOfYear(int year, int month, int day)
static int ydToDay(int year, int dayOfYear)
Definition bdlt_prolepticdateimputil.h:717
static int serialToDayNoCache(int serialDay)
Definition bdlt_prolepticdateimputil.h:671
static int serialToYear(int serialDay)
static int lastDayOfMonth(int year, int month)
static void serialToYmdNoCache(int *year, int *month, int *day, int serialDay)
Definition bdlt_prolepticdateimputil.h:701
static int ydToMonth(int year, int dayOfYear)
Definition bdlt_prolepticdateimputil.h:727
static int serialToMonth(int serialDay)
static void serialToYd(int *year, int *dayOfYear, int serialDay)
static void serialToYmd(int *year, int *month, int *day, int serialDay)
static bool isValidYearMonthDay(int year, int month, int day)
Definition bdlt_prolepticdateimputil.h:639
static void ydToMd(int *month, int *day, int year, int dayOfYear)
static int ymdToSerialNoCache(int year, int month, int day)
static int ymdToSerial(int year, int month, int day)
static int serialToDay(int serialDay)
static bool isLeapYear(int year)
Definition bdlt_prolepticdateimputil.h:617
static int ydToSerial(int year, int dayOfYear)
static bool isValidYearMonthDayNoCache(int year, int month, int day)
static int serialToMonthNoCache(int serialDay)
Definition bdlt_prolepticdateimputil.h:681
static int serialToDayOfWeek(int serialDay)
Definition bdlt_prolepticdateimputil.h:739
static int serialToYearNoCache(int serialDay)
Definition bdlt_prolepticdateimputil.h:691
static int ymdToDayOfWeek(int year, int month, int day)
Definition bdlt_prolepticdateimputil.h:757
static bool isValidYearDay(int year, int dayOfYear)