[#absl-FromDateTime]
= xref:absl.adoc[absl]::FromDateTime
:relfileprefix: ../
:mrdocs:

A convenience wrapper for `absl&colon;&colon;ConvertDateTime()` that simply returns the &quot;pre&quot; `absl&colon;&colon;Time`&period; That is, the unique result, or the instant that is correct using the pre&hyphen;transition offset (as if the transition never happened)&period;

== Synopsis

Declared in `&lt;absl&sol;time&sol;time&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;deprecated(&quot;Use &grave;absl&colon;&colon;FromCivil(CivilSecond, TimeZone)&grave;&period;&quot;)&rsqb;&rsqb;
xref:absl/Time.adoc[Time]
FromDateTime(
    int64&lowbar;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 &grave;absl&colon;&colon;FromCivil(CivilSecond, TimeZone)&grave;&period;. Use of this entity is allowed but discouraged.
====
== Description

Example&colon;

absl&colon;&colon;Time t &equals; absl&colon;&colon;FromDateTime(2017, 9, 26, 9, 30, 0, lax)&semi; &sol;&sol; t &equals; 2017&hyphen;09&hyphen;26 09&colon;30&colon;00 &hyphen;0700

Deprecated&period; Use `absl&colon;&colon;FromCivil(CivilSecond, TimeZone)`&period; Note that the behavior of `FromCivil()` differs from `FromDateTime()` for skipped civil times&period; If you care about that see `absl&colon;&colon;TimeZone&colon;&colon;At(absl&colon;&colon;CivilSecond)`&period;

== Return Value

The &quot;pre&quot; absolute time for the given civil time in `tz`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *year*
| The civil&hyphen;time year&period;
| *mon*
| The civil&hyphen;time month&period;
| *day*
| The civil&hyphen;time day&period;
| *hour*
| The civil&hyphen;time hour&period;
| *min*
| The civil&hyphen;time minute&period;
| *sec*
| The civil&hyphen;time second&period;
| *tz*
| The time zone to convert in&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
