FAST.Framework  1.0.0
Public Member Functions | Static Public Member Functions | Friends | List of all members
FDateTime Class Reference

#include <FDateTime.h>

Inheritance diagram for FDateTime:
Inheritance graph
[legend]
Collaboration diagram for FDateTime:
Collaboration graph
[legend]

Public Member Functions

 FDateTime (UInt year, UInt month, UInt day, UInt hour=0, UInt minute=0, UInt=0, FDateTimeKind kind=FDateTimeKind::Local)
 
 FDateTime (time_t timestamp)
 Constructor datetime object.
 
 FDateTime ()
 Constructor datetime object.
 
virtual ~FDateTime ()=default
 Destroys the datetime object.
 
Int Year () const
 Returns year of the datetime.
 
Int Month () const
 Returns month of the datetime.
 
Int Day () const
 Returns day of the datetime.
 
Int Hour () const
 Returns hour of the datetime.
 
Int Minute () const
 Returns minute of the datetime.
 
Int Second () const
 Returns second of the datetime.
 
FDayOfWeek DayOfWeek () const
 Returns day of week frome the datetime.
 
FDateTimeKind Kind () const
 Returns kind of the datetime.
 
ULong Timestamp () const
 Returns seconds.
 
Boolean IsDaylightSavingTime () const
 Returns TRUE if datetime daylight saving time, otherwise FALSE.
 
Boolean IsLeapYear () const
 Returns TRUE if year is leap, otherwise FALSE.
 
Int DaysInMonth () const
 Returns the number of days in the month.
 
Int DaysInYear () const
 Returns the number of days in the year.
 
Int DayOfYear () const
 Returns the number of day in the year.
 
FDateTime ToLocalTime () const
 Returns datetime as localtime.
 
FDateTime ToUniversalTime () const
 Returns datetime as localtime.
 
FDateTime AddYears (Int years) const
 Returns datetime object added years.
 
FDateTime AddMonths (Int months) const
 Returns datetime object added months.
 
FDateTime AddDays (Int days) const
 Returns datetime object added days.
 
FDateTime AddHours (Int hours) const
 Returns datetime object added hours.
 
FDateTime AddMinutes (Int minutes) const
 Returns datetime object added minutes.
 
FDateTime AddSeconds (Int seconds) const
 Returns datetime object added seconds.
 
const type_info & GetType () override
 Returns the type info over object.
 
FString GetName () const override
 Returns the name of object.
 
- Public Member Functions inherited from FObject
 FObject ()=default
 Constructor.
 
virtual ~FObject ()=default
 Destructor.
 

Static Public Member Functions

static Boolean IsLeapYear (Int year)
 Returns TRUE if year is leap, otherwise FALSE.
 
static Int DaysInMonth (Int year, Int month)
 Returns the number of days in the month.
 
static Int DaysInYear (Int year)
 Returns the number of days in the year.
 
static Int DayOfYear (Int year, Int month, Int day)
 Returns the number of day in the year.
 
static const FDateTime Now ()
 Returns current datetime.
 
static const FDateTime NowUTC ()
 Returns current datetime in utc.
 
static const FDateTime Today ()
 Returns current date.
 
static Boolean IsValid (UInt year, UInt month, UInt day, UInt hour, UInt minute, UInt second)
 

Friends

const friend FTimeSpan operator- (const FDateTime &first, const FDateTime &second)
 
Boolean operator== (const FDateTime &first, const FDateTime &second)
 
Boolean operator!= (const FDateTime &first, const FDateTime &second)
 
Boolean operator< (const FDateTime &first, const FDateTime &second)
 
Boolean operator> (const FDateTime &first, const FDateTime &second)
 
Boolean operator<= (const FDateTime &first, const FDateTime &second)
 
Boolean operator>= (const FDateTime &first, const FDateTime &second)
 

Detailed Description

Represents an instant in time, typically expressed as a date and time of day

Constructor & Destructor Documentation

◆ FDateTime()

FDateTime::FDateTime ( UInt  year,
UInt  month,
UInt  day,
UInt  hour = 0,
UInt  minute = 0,
UInt  second = 0,
FDateTimeKind  kind = FDateTimeKind::Local 
)
Parameters
dayConstructor datetime object

Member Function Documentation

◆ IsValid()

Boolean FDateTime::IsValid ( UInt  year,
UInt  month,
UInt  day,
UInt  hour,
UInt  minute,
UInt  second 
)
static
Parameters
dayTRUE if datetime attributes valid, otherwise FALSE

Friends And Related Function Documentation

◆ operator!=

Boolean operator!= ( const FDateTime first,
const FDateTime second 
)
friend
Parameters
firstReturns TRUE if first and second not equals, otherwise FALSE

◆ operator-

const friend FTimeSpan operator- ( const FDateTime first,
const FDateTime second 
)
friend
Parameters
firstReturns timespan object

◆ operator<

Boolean operator< ( const FDateTime first,
const FDateTime second 
)
friend
Parameters
firstReturns TRUE if first is lower as second, otherwise FALSE

◆ operator<=

Boolean operator<= ( const FDateTime first,
const FDateTime second 
)
friend
Parameters
firstReturns TRUE if first is lower as second, otherwise FALSE

◆ operator==

Boolean operator== ( const FDateTime first,
const FDateTime second 
)
friend
Parameters
firstReturns TRUE if first and second equals, otherwise FALSE

◆ operator>

Boolean operator> ( const FDateTime first,
const FDateTime second 
)
friend
Parameters
firstReturns TRUE if first is bigger as second, otherwise FALSE

◆ operator>=

Boolean operator>= ( const FDateTime first,
const FDateTime second 
)
friend
Parameters
firstReturns TRUE if first is bigger as second, otherwise FALSE

The documentation for this class was generated from the following files: