View source code Display the source code in std/datetime.d from which this page was generated on github. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

std.datetime.sys_time.this - multiple declarations

Function SysTime.this

Prototype

ref this(
  const(DateTime) dateTime,
  immutable(TimeZone) tz = null
) nothrow @safe;

Parameters

NameDescription
dateTime The DateTime to use to set this SysTime's internal std time. As DateTime has no concept of time zone, tz is used as its time zone.
tz The .TimeZone, TimeZone to use for this SysTime. If null, LocalTime will be used. The given DateTime is assumed to be in the given time zone.

Function SysTime.this

Prototype

ref this(
  long stdTime,
  immutable(TimeZone) tz = null
) pure nothrow @safe;

Note

Whereas the other constructors take in the given date/time, assume that it's in the given time zone, and convert it to hnsecs in UTC since midnight, January 1st, 1 A.D. UTC - i.e. std time - this constructor takes a std time, which is specifically already in UTC, so no conversion takes place. Of course, the various getter properties and functions will use the given time zone's conversion function to convert the results to that time zone, but no conversion of the arguments to this constructor takes place.

Parameters

NameDescription
stdTime The number of hnsecs since midnight, January 1st, 1 A.D. UTC.
tz The .TimeZone, TimeZone to use for this SysTime. If null, LocalTime will be used.

Function SysTime.this

Prototype

ref this(
  const(Date) date,
  immutable(TimeZone) tz = null
) nothrow @safe;

Parameters

NameDescription
date The Date to use to set this SysTime's internal std time. As Date has no concept of time zone, tz is used as its time zone.
tz The .TimeZone, TimeZone to use for this SysTime. If null, LocalTime will be used. The given Date is assumed to be in the given time zone.

Function SysTime.this

Scheduled for deprecation. Please use the overload which takes a core.time.Duration for the fractional seconds. This overload will be deprecated in 2.068.

Prototype

ref this(
  const(DateTime) dateTime,
  const(FracSec) fracSec,
  immutable(TimeZone) tz = null
) @safe;

Parameters

NameDescription
dateTime The DateTime to use to set this SysTime's internal std time. As DateTime has no concept of time zone, tz is used as its time zone.
fracSec The fractional seconds portion of the time.
tz The .TimeZone, TimeZone to use for this SysTime. If null, LocalTime will be used. The given DateTime is assumed to be in the given time zone.

Throws

DateTimeException if fracSec is negative.

Function SysTime.this

Prototype

ref this(
  const(DateTime) dateTime,
  const(Duration) fracSecs,
  immutable(TimeZone) tz = null
) @safe;

Parameters

NameDescription
dateTime The DateTime to use to set this SysTime's internal std time. As DateTime has no concept of time zone, tz is used as its time zone.
fracSecs The fractional seconds portion of the time.
tz The .TimeZone, TimeZone to use for this SysTime. If null, LocalTime will be used. The given DateTime is assumed to be in the given time zone.

Throws

DateTimeException if fracSecs is negative or if it's greater than or equal to one second.

Authors

Jonathan M Davis and Kato Shoichi

License

Boost License 1.0.

Comments