FDateTime::UtcNow

Gets the UTC date and time on this computer.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Misc/DateTime.h

Include

#include "Misc/DateTime.h"

Source

/Engine/Source/Runtime/Core/Private/Misc/DateTime.cpp

Syntax

static FDateTime UtcNow()

Remarks

Gets the UTC date and time on this computer.

This method returns the Coordinated Universal Time (UTC), which does not take the local computer's time zone and daylight savings settings into account. It should be used when comparing dates and times that should be independent of the user's locale. To get the date and time in the current locale, use Now() instead.

This method will use an estimate if USE_ESTIMATED_UTCNOW is 1. To calculate the estimate it will initialize a base reference time and keep track of the offset from that time with FPlatformTime::Cycles64(). This is appropriate for platforms whose implementations of FPlatformTime::UtcTime are expensive. To use, enable bUseEstimatedUtcNow in TargetRules. The rebase time is stored in time.EstimatedUtcNowRebaseTimeSeconds (default setting is 600 seconds).

Returns

Current date and time.

See Also

Now

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss