2019-02-25 14:48:22 +01:00
|
|
|
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
2016-03-29 12:45:22 +02:00
|
|
|
|
|
|
|
#ifndef DATETIME_H
|
|
|
|
#define DATETIME_H
|
|
|
|
|
|
|
|
#include "base/i2-base.hpp"
|
2018-01-18 13:50:38 +01:00
|
|
|
#include "base/datetime-ti.hpp"
|
2016-03-29 12:45:22 +02:00
|
|
|
#include "base/value.hpp"
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace icinga
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A date/time value.
|
|
|
|
*
|
|
|
|
* @ingroup base
|
|
|
|
*/
|
2018-01-04 06:11:04 +01:00
|
|
|
class DateTime final : public ObjectImpl<DateTime>
|
2016-03-29 12:45:22 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
DECLARE_OBJECT(DateTime);
|
|
|
|
|
|
|
|
DateTime(double value);
|
|
|
|
DateTime(const std::vector<Value>& args);
|
|
|
|
|
|
|
|
String Format(const String& format) const;
|
|
|
|
|
2018-01-04 05:12:56 +01:00
|
|
|
double GetValue() const override;
|
|
|
|
String ToString() const override;
|
2016-03-29 12:45:22 +02:00
|
|
|
|
2018-01-04 04:25:35 +01:00
|
|
|
static Object::Ptr GetPrototype();
|
2016-03-29 12:45:22 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
double m_Value;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* DATETIME_H */
|