Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

DateTime

Add this in your code:

#include <engine/time/date_time.h>

This class represents an instant in time.

Static methods


GetNow

Get the current date and time.

DateTime GetNow()

Code sample:

DateTime currentDateTime = DateTime::GetNow();

Public methods


ToString

Get a string representation of the date and time in the format: "hour:minute:second day/month/year".

std::string ToString() const

Code sample:

DateTime currentDateTime = DateTime::GetNow();
Debug::Print(currentDateTime.ToString());
// Prints: "12:49:53 31/5/2025"

Variables


NameTypeDescription
seconduint32_tNumber of seconds
minuteuint32_tNumber of minutes
houruint32_tNumber of hours
dayuint32_tNumber of days
monthuint32_tNumber of months
yearuint32_tNumber of years