SceRtc

Real Time Clock.

Information
If some ticks in rtc are lower than the constant set in SceRtc, those ticks are set to 0.

constant list per fw.

sceRtcCompareTickForDriver
Returns 0 if tick_1 == tick_2, -1 if tick_1 < tick_2 and 1 else.

sceRtcGetCurrentNetworkTickForDriver
If the current NetworkTick is less than 2015/01/01, the system will ignore the registry setting and update the NetworkTick from the internet.

sceRtcGetCurrentSecureTickForDriver
If the current SecureTick is less than 2015/01/01, it sets 0xDDDEF8B3A14000(1980/01/01 00:00:00 UTC) to the Secure Tick and returns error code 0x80251002.

sceRtcConvertTickToDateTimeForDriver
This is a guessed name.

Maybe reverse function of.

Used with the result of. Used by SceCoredump, SceSblGcAuthMgr.

SceRtcForDriver_0F9E02EF
Converts a time into a SceRtcTick for use e.g. with.

SceRtcForDriver_DE9F4515
It does:  so src is maybe of type SceRtcTick or just a time in microseconds.

sceRtcConvertDateTimeToTickForDriver
This is a guessed name.

Maybe reverse function of.

sceRtcConvertDateTimeToUnixTimeForDriver
This is a guessed name.

Used by SceCoredump.

sceRtcSynchronizeForDriver
Initializes SceRtc internal flags.

SceRtcForDriver_ABA035B7
Reset all SceRtc internal flags to 0.

Returns 0.

sceRtcGetCurrentToolSecureTickForDriver
This is a guessed name.

Used on Tool only. Used when checking DevKit activation license expire date.

Creates a tick using SceKernelThreadMgr.

SceRtcForDriver_9C8AF264
Adds time (in second) to a time structure (in nanosecond).

SceRtcForDriver_CE51C2A1
Adds time (in microseconds) to a time structure (in nanosecond).

SceRtcForDriver_0CB72FAF
Used by SceCompat.

SceRtcForDriver_FFD7A04F
Used indirectly by SceProcessmgr.

SceRtcForDriver_9097EF0D
Used indirectly by SceProcessmgr.

SceRtcForDriver_0F800878
Used indirectly by SceProcessmgr.

How to get current time and date
Getting the current time and date involves Syscon scratchpad and Syscon command 0x11. Syscon command 0x11 returns twice the number of seconds Syscon has been running since its power on. Syscon scratchpad contains at offset 0x10 the timestamp when Syscon "started" running. It is stored in the following format: microseconds since 01/01/0001 and divided by 2^19. By adding those values together, the OS obtains the current time and date.

In pseudocode: