Implement time conversion routines for Unix and XT epoch formats
Some checks failed
Builds / ExectOS (amd64, debug) (push) Failing after -59m32s
Builds / ExectOS (amd64, release) (push) Failing after -59m35s
Builds / ExectOS (i686, debug) (push) Failing after -59m32s
Builds / ExectOS (i686, release) (push) Failing after -59m34s

This commit is contained in:
2026-04-24 17:48:44 +02:00
parent 341759a325
commit 3b76146d53
7 changed files with 238 additions and 0 deletions

View File

@@ -1033,6 +1033,52 @@ RtlTestBit(IN PRTL_BITMAP BitMap,
return RTL::BitMap::TestBit(BitMap, Bit);
}
/**
* Converts a TIME_FIELDS calendar structure to a 64-bit Unix timestamp.
*
* @param TimeFields
* Supplies a pointer to a fully populated TIME_FIELDS structure.
*
* @param UnixTime
* Supplies a pointer to a 64-bit integer that receives the number of
* seconds elapsed since January 1, 1970.
*
* @return This routine returns a status code.
*
* @since XT 1.0
*/
XTCLINK
XTAPI
XTSTATUS
RtlTimeFieldsToUnixEpoch(IN PTIME_FIELDS TimeFields,
OUT PLONGLONG UnixTime)
{
return RTL::Time::TimeFieldsToUnixEpoch(TimeFields, UnixTime);
}
/**
* Converts a TIME_FIELDS calendar structure to a 64-bit XT timestamp.
*
* @param TimeFields
* Supplies a pointer to a fully populated TIME_FIELDS structure.
*
* @param Time
* Supplies a pointer to variable that receives the converted time value in 100-nanosecond
* intervals since January 1, 1601.
*
* @return This routine returns the status code.
*
* @since XT 1.0
*/
XTCLINK
XTAPI
XTSTATUS
RtlTimeFieldsToXtEpoch(IN PTIME_FIELDS TimeFields,
OUT PLARGE_INTEGER XtTime)
{
return RTL::Time::TimeFieldsToXtEpoch(TimeFields, XtTime);
}
/**
* Finds the next token in a NULL-terminated string.
*