[#absl-FromDateTime] = xref:absl.adoc[absl]::FromDateTime :relfileprefix: ../ :mrdocs: A convenience wrapper for `absl::ConvertDateTime()` that simply returns the "pre" `absl::Time`. That is, the unique result, or the instant that is correct using the pre‐transition offset (as if the transition never happened). == Synopsis Declared in `<absl/time/time.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[deprecated("Use `absl::FromCivil(CivilSecond, TimeZone)`.")]] xref:absl/Time.adoc[Time] FromDateTime( int64_t year, int mon, int day, int hour, int min, int sec, xref:absl/TimeZone.adoc[TimeZone] tz); ---- [WARNING] ==== https://en.cppreference.com/cpp/language/attributes/deprecated[Deprecated^]: Use `absl::FromCivil(CivilSecond, TimeZone)`.. Use of this entity is allowed but discouraged. ==== == Description Example: absl::Time t = absl::FromDateTime(2017, 9, 26, 9, 30, 0, lax); // t = 2017‐09‐26 09:30:00 ‐0700 Deprecated. Use `absl::FromCivil(CivilSecond, TimeZone)`. Note that the behavior of `FromCivil()` differs from `FromDateTime()` for skipped civil times. If you care about that see `absl::TimeZone::At(absl::CivilSecond)`. == Return Value The "pre" absolute time for the given civil time in `tz`. == Parameters [cols="1,4"] |=== | Name| Description | *year* | The civil‐time year. | *mon* | The civil‐time month. | *day* | The civil‐time day. | *hour* | The civil‐time hour. | *min* | The civil‐time minute. | *sec* | The civil‐time second. | *tz* | The time zone to convert in. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#