class Core::Time

Overview

Time data structure expressed in hours, minutes, seconds, and milliseconds. More…

#include <coredatetime.h>

class Time
{
public:
    // enums

    enum Constants;

    // construction

    Time(int _hour = 0, int _minute = 0, int _second = 0, int _ms = 0);

    // methods

    int getHour() const;
    int getMinute() const;
    int getSecond() const;
    int getMilliseconds() const;
    void setHour(int _hour);
    void setMinute(int _minute);
    void setSecond(int _second);
    void setMilliseconds(int _ms);
    int64 toSeconds() const;
    void fromSeconds(int64 seconds);
    int64 toMilliseconds() const;
    Time& operator () (int _hour, int _minute = 0, int _second = 0, int _ms = 0);
    bool operator == (const Time& t) const;
    bool operator != (const Time& t) const;
    bool operator > (const Time& t) const;
    bool operator < (const Time& t) const;
    bool operator >= (const Time& t) const;
    bool operator <= (const Time& t) const;
};

Detailed Documentation

Time data structure expressed in hours, minutes, seconds, and milliseconds.

Construction

Time(int _hour = 0, int _minute = 0, int _second = 0, int _ms = 0)

Construct time.

Methods

int64 toSeconds() const

Convert time to seconds.

void fromSeconds(int64 seconds)

Assign time from seconds.

int64 toMilliseconds() const

Convert time to milliseconds.