LibDate.h is a powerful C++ header-only library designed to handle a wide range of date and calendar operations, including calculating day differences, leap years, weekdays, and formatting dates with ease.
- ποΈ Leap year detection.
- π Calculate total days, hours, minutes, or seconds in months and years.
- β Easily add days, weeks, months, or years to a date.
- β Subtract time periods from a date (e.g., go back one month).
- π Print full calendars for a month or year.
- π Compare two dates: is one before, after, or equal to another?
- π§ Work with date periods (start/end date) and calculate overlaps.
- π€ Format dates using custom string templates (
dd/mm/yyyy,Month dd yyyy, etc.) - πΌ Recognize business days and weekends.
enDayOfWeek: Enum for days from Sunday to Saturday.enMounth: Enum for months from January to December.enCompareTwoDate: Enum to compare two dates (BEFORE,EQUAL,AFTER).
stDateInformation: Represents a date (day, month, year).stPeriodOfDate: Represents a time period between two dates.
bool isLeapYear(int year)int numberOfDayInYear(int year)int numberOfDayInMonth(int year, int month)
calcNumberOfHourInYear,calcNumberOfMinutsInYear,calcNumberOfSecoundsInYearcalcNumberOfHourInMonth,calcNumberOfMinutsInMonth,calcNumberOfSecoundsInMonth
increasingDayByOneincreasingXWeek,increasingOneMonth,increasingXMonthincreasingXYear,increasingOneDecade,increasingOneCentury,increasingOneMillennium
decreasingDayByOnedecreasingWeekX,decreasingOneMonth,decreasingMonthXdecreasingYearX,decreasingOneDecade,decreasingOneMilleninum
printCalenderOfMonth(year, month)printAllMonthCalenderAccordingYear(year)
cheakDateOneLessThanDateTwoIsDate1EqualDate2Date1AfterDate2compareTwoDatesisOverLapTwoDateisDateWithinPeriod
printDateFormat(date, separator)replaseDatekDAY_kMONTH_kYEAR_FormatDate(date, format)convertRecordToLine(date)splitDateInformation(string date)fillDateInformation(vector<string>)
findTheOrderOfDayInWeekfindDayOfWeekString(index, fullName)findNameMounthString(index, fullName)
calcDifferanceBetweenTwoDatevacationDays(date1, date2)dayUntilEndOfWeek,dayUntilEndOfMonth,dayUntilEndOfYear
replaseDatekDAY_kMONTH_kYEAR_FormatDate(date, "dd/mm/yyyy")
replaseDatekDAY_kMONTH_kYEAR_FormatDate(date, "DDDD, dd Month yyyy")
replaseDatekDAY_kMONTH_kYEAR_FormatDate(date, "dd-MMM-yy")Ahmed Jehad Ahmed
π GitHub Profile
π§ Email Contact