16 EXPECT_FALSE(date_time::valid_date(2000, 0, 32));
22 EXPECT_EQ(
"2000-01-12 03:04:05", dt2.
str(
false));
23 EXPECT_EQ(
"2000-01-12 03:04:05.666", dt2.
str(
true));
36 EXPECT_EQ(
"08:04:05", t2.
str_time(
false));
37 EXPECT_EQ(
"08:04:05.666", t2.
str_time(
true));
45 EXPECT_EQ(3, ts.
days());
46 EXPECT_EQ(2, ts.
hours());
55 EXPECT_EQ(
"24.1234", d.
str());
Class representing SQL time.
TEST_F(StructureTest, testDateTime)
time add_milliseconds(s32 milliseconds) const
Adds a certain amount of milliseconds to the current time.
u32 days() const
Get number of days.
u16 milliseconds() const
Get number of milliseconds.
const std::string str_time(bool with_millisecond=false) const
Converts the time to a string with the format hh:mm:ss[.nnn].
date_time add_milliseconds(s32 milliseconds) const
Add milliseconds to current date with second wrapping.
date_time add_days(s32 days) const
Add days to current date with month wrapping.
Class used to represent SQL date_time.
time_span time_between(const date_time &dt) const
Calculates the time_span between this date_time and dt.
time add_hours(s32 hours) const
Adds a certain amount of hours to the current time.
u8 minutes() const
Get number of hours.
u8 hours() const
Get number of hours.
const std::string str(bool with_millisecond=false) const
Converts the date and time to ISO 8601 string yyyy-mm-dd hh:mm:ss[.nnn].