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

@@ -22,6 +22,7 @@
#include <rtl/sha1.hh>
#include <rtl/slist.hh>
#include <rtl/string.hh>
#include <rtl/time.hh>
#include <rtl/widestr.hh>
#endif /* __XTOSKRNL_RTL_HH */

View File

@@ -0,0 +1,36 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/includes/rtl/time.hh
* DESCRIPTION: Time conversion support
* DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
*/
#ifndef __XTOSKRNL_RTL_TIME_HH
#define __XTOSKRNL_RTL_TIME_HH
#include <xtos.hh>
/* Runtime Library */
namespace RTL
{
class Time
{
private:
STATIC CUSHORT DaysInMonth[2][12];
STATIC CUSHORT DaysPrecedingMonth[2][12];
public:
STATIC XTAPI XTSTATUS TimeFieldsToUnixEpoch(IN PTIME_FIELDS TimeFields,
OUT PLONGLONG UnixTime);
STATIC XTAPI XTSTATUS TimeFieldsToXtEpoch(IN PTIME_FIELDS TimeFields,
OUT PLARGE_INTEGER XtTime);
private:
STATIC XTFASTCALL BOOLEAN LeapYear(SHORT Year);
};
}
#endif /* __XTOSKRNL_RTL_TIME_HH */