| AngelScript |

Loading...
Searching...
No Matches
datetime object

Path: /sdk/add_on/datetime/

The `CDateTime` class provides a way for scripts to get the system date and time.

Register the type with the `RegisterScriptDateTime(asIScriptEngine*)` function.

Note
  This class requires C++11 or later to compile.

# Public C++ interface

class CDateTime
{
public:
// Constructors
CDateTime();
CDateTime(const CDateTime &other);
CDateTime(asUINT year, asUINT month, asUINT day, asUINT hour, asUINT minute, asUINT second);
// Copy the stored value from another any object
CDateTime &operator=(const CDateTime &other);
// Accessors
asUINT getYear() const;
asUINT getMonth() const;
asUINT getDay() const;
asUINT getHour() const;
asUINT getMinute() const;
asUINT getSecond() const;
// Setters
// Returns true if valid
bool setDate(asUINT year, asUINT month, asUINT day);
bool setTime(asUINT hour, asUINT minute, asUINT second);
// Operators
// Return difference in seconds
asINT64 operator-(const CDateTime &other) const;
CDateTime operator+(asINT64 seconds) const;
friend CDateTime operator+(asINT64 seconds, const CDateTime &other);
CDateTime & operator+=(asINT64 seconds);
CDateTime operator-(asINT64 seconds) const;
friend CDateTime operator-(asINT64 seconds, const CDateTime &other);
CDateTime & operator-=(asINT64 seconds);
bool operator==(const CDateTime &other) const;
bool operator<(const CDateTime &other) const;
};
asINT64
__int64 asINT64
64 bit integer
Definition: angelscript.h:630
asUINT
unsigned int asUINT
32 bit unsigned integer
Definition: angelscript.h:610

# Public script interface

See also
  datetime in the script language