RealDocs

UKismetMathLibrary::FromDays

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Constructs an FTimespan from a number of days. Fractional values are supported, so 0.5 produces a 12-hour span.

Caveats & Gotchas

  • Negative values are valid — FTimespan supports negative durations. FromDays(-1) creates a span of minus one day, which can produce unexpected results when added to a date if not anticipated.
  • Internally FTimespan stores ticks (100 ns units). Passing an extremely large double (beyond ~10,000 years) silently clamps or wraps at the int64 tick limit.

Signature

static ENGINE_API FTimespan FromDays( double Days );

Parameters

Name Type Description Default
Days double Number of days (may be fractional, e.g. 1.5 = 36 hours).

Return Type

FTimespan

Example

Build a 3-day event window C++
FTimespan EventWindow = UKismetMathLibrary::FromDays(3.0);
FDateTime EventEnd = EventStart + EventWindow;

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.