Module |
|
Header |
/Engine/Source/Runtime/Core/Public/Misc/Timespan.h |
Include |
#include "Misc/Timespan.h" |
struct FTimespan
Implements a time span.
A time span is the difference between two dates and times. For example, the time span between 12:00:00 January 1, 2000 and 18:00:00 January 2, 2000 is 30.0 hours. Time spans are measured in positive or negative ticks depending on whether the difference is measured forward or backward. Each tick has a resolution of 0.1 microseconds (= 100 nanoseconds).
In conjunction with the companion class FDateTime, time spans can be used to perform date and time based arithmetic, such as calculating the difference between two dates or adding a certain amount of time to a given date.
When initializing time span values from single components, consider using the FromHours, FromMinutes, FromSeconds, Zero, MinValue and related methods instead of calling the overloaded constructors as they will make your code easier to read and understand.
Name | Description | |
---|---|---|
|
FTimespan() |
Default constructor (zero initialization). |
|
FTimespan ( |
Create and initialize a new time interval with the specified number of ticks. |
|
FTimespan ( |
Create and initialize a new time interval with the specified number of hours, minutes and seconds. |
|
FTimespan ( |
Create and initialize a new time interval with the specified number of days, hours, minutes and seconds. |
|
FTimespan ( |
Create and initialize a new time interval with the specified number of days, hours, minutes and seconds. |
Name | Description | ||
---|---|---|---|
|
void |
Assign ( |
Assign the specified components to this time span. |
|
bool |
ExportTextItem |
Export this time span value to a string. |
|
FromDays ( |
Create a time span that represents the specified number of days. |
|
|
FromHours ( |
Create a time span that represents the specified number of hours. |
|
|
FromMicroseconds ( |
Create a time span that represents the specified number of microseconds. |
|
|
FromMilliseconds ( |
Create a time span that represents the specified number of milliseconds. |
|
|
FromMinutes ( |
Create a time span that represents the specified number of minutes. |
|
|
FromSeconds ( |
Create a time span that represents the specified number of seconds. |
|
|
int32 |
GetDays() |
Get the days component of this time span. |
|
GetDuration() |
Get a time span with the absolute value of this time span. |
|
|
int32 |
GetFractionMicro() |
Gets the fractional seconds (in microsecond resolution). |
|
int32 |
GetFractionMilli() |
Gets the fractional seconds (in millisecond resolution). |
|
int32 |
GetFractionNano() |
Gets the fractional seconds (in nanosecond resolution). |
|
int32 |
GetFractionTicks() |
Gets the fractional ticks (in 100 nanosecond resolution). |
|
int32 |
GetHours() |
Gets the hours component of this time span. |
|
int32 |
GetMinutes() |
Get the minutes component of this time span. |
|
int32 |
GetSeconds() |
Get the seconds component of this time span. |
|
int64 |
GetTicks() |
Get the number of ticks represented by this time span. |
|
double |
GetTotalDays() |
Get the total number of days represented by this time span. |
|
double |
GetTotalHours() |
Get the total number of hours represented by this time span. |
|
double |
GetTotalMicroseconds() |
Get the total number of microseconds represented by this time span. |
|
double |
GetTotalMilliseconds() |
Get the total number of milliseconds represented by this time span. |
|
double |
GetTotalMinutes() |
Get the total number of minutes represented by this time span. |
|
double |
GetTotalSeconds() |
Get the total number of seconds represented by this time span. |
|
bool |
ImportTextItem ( |
Import a time span value from a text buffer. |
|
bool |
IsZero() |
Check whether this time span is zero. |
|
MaxValue() |
Return the maximum time span value. |
|
|
MinValue() |
Return the minimum time span value. |
|
|
bool |
NetSerialize ( |
Serializes this date and time for network transmission |
|
bool |
Parse |
Convert a string to a time span. |
|
double |
Ratio |
Ratio between two time spans (handles zero values). |
|
bool |
Serialize ( |
Serialize this time span from or into the specified archive. |
|
ToString() |
Return the string representation of this time span using a default format. |
|
|
ToString ( |
Convert this time span to its string representation. |
|
|
Zero() |
Return the zero time span value. |
Name | Description | ||
---|---|---|---|
|
operator- ( |
Return the result of subtracting the given time span from this time span. |
|
|
operator-() |
Return the inverse of this time span. |
|
|
bool |
operator!= ( |
Compare this time span with the given time span for inequality. |
|
operator% ( |
Return the result of calculating the modulus of this time span with another time span. |
|
|
operator%= ( |
Calculate this time span modulo another. |
|
|
operator* ( |
Return the result of multiplying the this time span with the given scalar. |
|
|
operator*= ( |
Multiply this time span with the given scalar. |
|
|
operator/ ( |
Return the result of dividing the this time span by the given scalar. |
|
|
operator/= ( |
Divide this time span by the given scalar. |
|
|
operator+ ( |
Return the result of adding the given time span to this time span. |
|
|
operator+= ( |
Adds the given time span to this time span. |
|
|
bool |
operator< ( |
Check whether this time span is less than the given time span. |
|
bool |
operator<= ( |
Check whether this time span is less than or equal to the given time span. |
|
operator-= ( |
Subtract the given time span from this time span. |
|
|
bool |
operator== ( |
Compare this time span with the given time span for equality. |
|
bool |
operator> ( |
Check whether this time span is greater than the given time span. |
|
bool |
operator>= ( |
Check whether this time span is greater than or equal to the given time span. |