9#ifndef HPP_ALIB_CAMP_CALENDAR
10#define HPP_ALIB_CAMP_CALENDAR 1
12#if !defined (HPP_ALIB_TIME_DATETIME)
19#if !defined (HPP_ALIB_TIME_TICKS)
23#if !defined (HPP_ALIB_STRINGS_ASTRING)
27#if !defined (HPP_ALIB_STRINGS_SUBSTRING)
32namespace alib {
namespace lang::system {
107 Set( timeStamp, timezone );
121 int hour= 0,
int minute= 0,
int second= 0,
int millisecond= 0 )
309 return DateTime::Duration::FromNanoseconds(
ToNanoSeconds() );
413 Set( year, month, day, dayOfWeek );
434 ,calendarDateTime.
Month
435 ,calendarDateTime.
Day
446 Set( dateTime, timezone);
463 void Set(
int year,
int month,
int day,
int dayOfWeek= -1);
492 int hour= 12,
int minute= 0,
int second= 0 )
const;
512 int Day()
const {
return int( (
stamp >> 3) & 31 ); }
537 return (*
this) + (-daysToSubtract);
583 return (*
this)= (*this) + daysToAdd;
593 return (*
this)+= (- daysToSubtract);
686namespace APPENDABLES {
690template<
typename TChar>
struct T_Append<time::DateTime::Duration ,TChar>
710template<
typename TChar>
struct T_Append<time::Ticks::Duration ,TChar>
ALIB_API void Set(const DateTime &timeStamp, lang::Timezone timezone=lang::Timezone::Local)
CalendarDateTime(const DateTime &timeStamp, lang::Timezone timezone=lang::Timezone::Local)
CalendarDateTime(int year, int month=1, int day=1, int hour=0, int minute=0, int second=0, int millisecond=0)
CalendarDateTime(lang::Initialization init=lang::Initialization::Perform)
bool operator<=(const CalendarDate &other) const
CalendarDate operator-=(int daysToSubtract)
bool operator==(const CalendarDate &other) const
CalendarDate operator-(int daysToSubtract) const
bool operator!=(const CalendarDate &other) const
ALIB_API CalendarDate operator--()
ALIB_API CalendarDate operator+(int daysToAdd) const
ALIB_API CalendarDate(const CalendarDateTime &calendarDateTime)
bool operator>(const CalendarDate &other) const
CalendarDate operator+=(int daysToAdd)
CalendarDate operator--(int)
bool operator>=(const CalendarDate &other) const
bool operator<(const CalendarDate &other) const
CalendarDate(CalendarDate &&) noexcept=default
uint32_t stamp
Encoded date value.
CalendarDate(lang::Timezone timezone)
CalendarDate operator++(int)
ALIB_API CalendarDate operator++()
CalendarDate(const DateTime &dateTime, lang::Timezone timezone)
ALIB_API void Set(int year, int month, int day, int dayOfWeek=-1)
CalendarDate(const CalendarDate &) noexcept=default
ALIB_API CalendarDateTime ToCalendarDateTime() const
CalendarDuration(DateTime::Duration duration)
ALIB_API int64_t ToNanoSeconds()
CalendarDuration(int64_t nanos)
DateTime::Duration ToDateTimeDuration()
void FromDuration(Ticks::Duration duration)
ALIB_API void FromNanoSeconds(int64_t nanos)
Ticks::Duration ToTicksDuration()
CalendarDuration(Ticks::Duration duration)
void FromDuration(DateTime::Duration duration)
CalendarDuration(lang::Initialization init=lang::Initialization::Perform)
#define ALIB_ASSERT_MODULE(modulename)
ALIB_API void FFormat_DateTime(const Box &self, const String &formatSpec, NumberFormat &nf, AString &target)
@ Local
Denotes local time.
@ Keep
Chooses not no clear existing data.
@ Get
Denotes to search data.
strings::TFormat< character > Format
Type alias in namespace alib.
time::DateTime DateTime
Type alias in namespace alib.
ALIB_API void operator()(TAString< TChar > &target, const time::DateTime::Duration duration)
void operator()(TAString< TChar > &target, const time::Ticks::Duration duration)
void operator()(TAString< TChar > &target, const TAppendable &src)