absl::ConvertDateTime

Legacy version of absl::TimeZone::At(absl::CivilSecond) that takes the civil time as six, separate values (YMDHMS).

Synopsis

Declared in <absl/time/time.h>

[[deprecated("Use `absl::TimeZone::At(CivilSecond)`.")]]
TimeConversion
ConvertDateTime(
    int64_t year,
    int mon,
    int day,
    int hour,
    int min,
    int sec,
    TimeZone tz);

WARNING

Deprecated: Use `absl::TimeZone::At(CivilSecond)`.. Use of this entity is allowed but discouraged.

Description

The input month, day, hour, minute, and second values can be outside of their valid ranges, in which case they will be "normalized" during the conversion.

Example:

// "October 32" normalizes to "November 1". absl::TimeConversion tc = absl::ConvertDateTime(2013, 10, 32, 8, 30, 0, lax); // tc.kind == TimeConversion::UNIQUE && tc.normalized == true // absl::ToCivilDay(tc.pre, tz).month() == 11 // absl::ToCivilDay(tc.pre, tz).day() == 1

Deprecated. Use absl::TimeZone::At(CivilSecond).

Return Value

The conversion result for the given civil time in tz.

Parameters

NameDescription
yearThe civil-time year.
monThe civil-time month.
dayThe civil-time day.
hourThe civil-time hour.
minThe civil-time minute.
secThe civil-time second.
tzThe time zone to convert in.