19#ifndef INCLUDED_TOOLS_DATETIME_HXX
20#define INCLUDED_TOOLS_DATETIME_HXX
25#include <com/sun/star/util/DateTime.hpp>
48 explicit DateTime( DateTimeInitSystem );
50 Date( rDateTime ),
Time( rDateTime ) {}
55 DateTime(
const css::util::DateTime& rDateTime );
67 if ( Date::operator!=( rDateTime ) )
73 {
return (Date::operator==( rDateTime ) &&
74 Time::operator==( rDateTime )); }
76 {
return (Date::operator!=( rDateTime ) ||
77 Time::operator!=( rDateTime )); }
83 sal_Int64 GetSecFromDateTime(
const Date& rDate )
const;
88 void AddTime(
double fTimeInDays );
94 void NormalizeTimeRemainderAndApply(
tools::Time& rTime );
101 {
return operator+( rDateTime, -fTimeInDays ); }
114 {
return static_cast<const Date&
>(rDateTime) - rDate; }
121 void GetWin32FileDateTime( sal_uInt32 & rLower, sal_uInt32 & rUpper )
const;
122 static DateTime CreateFromWin32FileDateTime( sal_uInt32 rLower, sal_uInt32 rUpper );
126 static DateTime CreateFromUnixTime(
const double fSecondsSinceEpoch );
132 Time::operator=( rDateTime );
136template<
typename charT,
typename traits >
137inline std::basic_ostream<charT, traits> &
operator <<(
138 std::basic_ostream<charT, traits> & stream,
const DateTime& datetime)
141 std::setw(2) << std::setfill(
'0') << datetime.
GetMonth() <<
'-' <<
142 std::setw(2) << std::setfill(
'0') << datetime.
GetDay() <<
' ' <<
143 std::setw(2) << std::setfill(
'0') << datetime.
GetHour() <<
':' <<
144 std::setw(2) << std::setfill(
'0') << datetime.
GetMin() <<
':' <<
145 std::setw(2) << std::setfill(
'0') << datetime.
GetSec() <<
"." <<
146 std::setw(9) << std::setfill(
'0') << datetime.
GetNanoSec();
DateTime(DateTimeInitEmpty)
DateTime(const DateTime &rDateTime)
DateTime(const Date &rDate)
DateTime(const tools::Time &rTime)
void ConvertToLocalTime()
css::util::DateTime GetUNODateTime() const
DateTime & operator=(const DateTime &rDateTime)
bool IsEqualIgnoreNanoSec(const DateTime &rDateTime) const
DateTime(const Date &rDate, const tools::Time &rTime)
Represents a date in the proleptic Gregorian calendar.
TOOLS_DLLPUBLIC friend Date operator+(const Date &rDate, sal_Int32 nDays)
Date & operator=(const Date &rDate)
bool IsBetween(const Date &rFrom, const Date &rTo) const
sal_Int16 GetYear() const
sal_uInt16 GetDay() const
bool operator>(const Date &rDate) const
bool operator==(const Date &rDate) const
bool operator>=(const Date &rDate) const
TOOLS_DLLPUBLIC friend Date operator-(const Date &rDate, sal_Int32 nDays)
bool operator<(const Date &rDate) const
bool operator<=(const Date &rDate) const
bool operator!=(const Date &rDate) const
sal_uInt16 GetMonth() const
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, const DateTime &datetime)
Reference< XOutputStream > stream
constexpr OUStringLiteral EMPTY
tools::Rectangle & operator+=(tools::Rectangle &rRect, const SvBorder &rBorder)