mysql-native v3.0.0

API Reference Home: [This Version] [Latest Version] [Other Versions]


toTimeDiff - multiple declarations

Function toTimeDiff

Function to extract a time difference from a binary encoded row.

TimeDiff toTimeDiff (
  const(ubyte[]) a
);

Time/date structures are packed by the server into a byte sub-packet with a leading length byte, and a minimal number of bytes to embody the data.

Parameters

NameDescription
a slice of a protocol packet beginning at the length byte for a chunk of time data

Returns

A populated or default initialized TimeDiff struct.

Function toTimeDiff

Function to extract a time difference from a text encoded column value.

TimeDiff toTimeDiff (
  string s
);

Text representations of a time difference are like -750:12:02 - 750 hours 12 minutes and two seconds ago.

Parameters

NameDescription
s A string representation of the time difference.

Returns

A populated or default initialized TimeDiff struct.