PSPSDK 2025-02-06
Loading...
Searching...
No Matches
psprtc.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * psprtc.h - Prototypes for the sceRtc library
7 *
8 * Function returns marked with (?) have not been tested.
9 *
10 * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
11 *
12 */
13#ifndef __PSPRTC_H__
14#define __PSPRTC_H__
15
16#include <time.h>
17#include <psptypes.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
32
39
47
56
64
72int sceRtcConvertUtcToLocalTime(const u64* tickUTC, u64* tickLocal);
73
81int sceRtcConvertLocalTimeToUTC(const u64* tickLocal, u64* tickUTC);
82
89int sceRtcIsLeapYear(int year);
90
98int sceRtcGetDaysInMonth(int year, int month);
99
108int sceRtcGetDayOfWeek(int year, int month, int day);
109
117
125int sceRtcSetTick(ScePspDateTime* date, const u64* tick);
126
134int sceRtcGetTick(const ScePspDateTime* date, u64 *tick);
135
143int sceRtcCompareTick(const u64* tick1, const u64* tick2);
144
153int sceRtcTickAddTicks(u64* destTick, const u64* srcTick, u64 numTicks);
154
163int sceRtcTickAddMicroseconds(u64* destTick, const u64* srcTick, u64 numMS);
164
173int sceRtcTickAddSeconds(u64* destTick, const u64* srcTick, u64 numSecs);
174
183int sceRtcTickAddMinutes(u64* destTick, const u64* srcTick, u64 numMins);
184
193int sceRtcTickAddHours(u64* destTick, const u64* srcTick, int numHours);
194
203int sceRtcTickAddDays(u64* destTick, const u64* srcTick, int numDays);
204
213int sceRtcTickAddWeeks(u64* destTick, const u64* srcTick, int numWeeks);
214
215
224int sceRtcTickAddMonths(u64* destTick, const u64* srcTick, int numMonths);
225
234int sceRtcTickAddYears(u64* destTick, const u64* srcTick, int numYears);
235
236int sceRtcSetTime_t(ScePspDateTime* date, const time_t time);
237int sceRtcGetTime_t(const ScePspDateTime* date, time_t *time);
242
243int sceRtcParseDateTime(u64 *destTick, const char *dateString);
244
248int sceRtcFormatRFC2822(char *pszDateTime, const u64 *pUtc, int iTimeZoneMinutes);
249
253int sceRtcFormatRFC2822LocalTime(char *pszDateTime, const u64 *pUtc);
254
258int sceRtcFormatRFC3339(char *pszDateTime, const u64 *pUtc, int iTimeZoneMinutes);
259
263int sceRtcFormatRFC3339LocalTime(char *pszDateTime, const u64 *pUtc);
264
268int sceRtcParseRFC3339(u64 *pUtc, const char *pszDateTime);
269
270#ifdef __cplusplus
271}
272#endif
273
274#endif
int sceRtcTickAddSeconds(u64 *destTick, const u64 *srcTick, u64 numSecs)
Add an amount of seconds to a tick.
int sceRtcTickAddHours(u64 *destTick, const u64 *srcTick, int numHours)
Add an amount of hours to a tick.
int sceRtcTickAddMinutes(u64 *destTick, const u64 *srcTick, u64 numMins)
Add an amount of minutes to a tick.
int sceRtcGetWin32FileTime(ScePspDateTime *date, u64 *win32Time)
int sceRtcGetTick(const ScePspDateTime *date, u64 *tick)
Set ticks based on a ScePspDateTime struct.
int sceRtcGetTime_t(const ScePspDateTime *date, time_t *time)
int sceRtcFormatRFC2822(char *pszDateTime, const u64 *pUtc, int iTimeZoneMinutes)
Format Tick-representation UTC time in RFC2822 format.
int sceRtcGetCurrentTick(u64 *tick)
Get current tick count.
int sceRtcGetDayOfWeek(int year, int month, int day)
Get day of the week for a date.
int sceRtcSetDosTime(ScePspDateTime *date, u32 dosTime)
int sceRtcFormatRFC3339LocalTime(char *pszDateTime, const u64 *pUtc)
Format Tick-representation UTC time in RFC3339(ISO8601) format.
int sceRtcCompareTick(const u64 *tick1, const u64 *tick2)
Compare two ticks.
int sceRtcGetDosTime(ScePspDateTime *date, u32 dosTime)
int sceRtcTickAddTicks(u64 *destTick, const u64 *srcTick, u64 numTicks)
Add two ticks.
int sceRtcTickAddMonths(u64 *destTick, const u64 *srcTick, int numMonths)
Add an amount of months to a tick.
int sceRtcParseRFC3339(u64 *pUtc, const char *pszDateTime)
Parse time information represented in RFC3339 format.
int sceRtcFormatRFC2822LocalTime(char *pszDateTime, const u64 *pUtc)
Format Tick-representation UTC time in RFC2822 format.
int sceRtcFormatRFC3339(char *pszDateTime, const u64 *pUtc, int iTimeZoneMinutes)
Format Tick-representation UTC time in RFC3339(ISO8601) format.
int sceRtcConvertUtcToLocalTime(const u64 *tickUTC, u64 *tickLocal)
Convert a UTC-based tickcount into a local time tick count.
int sceRtcConvertLocalTimeToUTC(const u64 *tickLocal, u64 *tickUTC)
Convert a local time based tickcount into a UTC-based tick count.
u32 sceRtcGetTickResolution()
Get the resolution of the tick counter.
int sceRtcParseDateTime(u64 *destTick, const char *dateString)
int sceRtcGetDaysInMonth(int year, int month)
Get number of days in a specific month.
int sceRtcIsLeapYear(int year)
Check if a year is a leap year.
pspRtcCheckValidErrors
Definition psprtc.h:23
@ PSP_TIME_INVALID_SECONDS
Definition psprtc.h:29
@ PSP_TIME_INVALID_HOUR
Definition psprtc.h:27
@ PSP_TIME_INVALID_MONTH
Definition psprtc.h:25
@ PSP_TIME_INVALID_MINUTES
Definition psprtc.h:28
@ PSP_TIME_INVALID_MICROSECONDS
Definition psprtc.h:30
@ PSP_TIME_INVALID_YEAR
Definition psprtc.h:24
@ PSP_TIME_INVALID_DAY
Definition psprtc.h:26
int sceRtcTickAddDays(u64 *destTick, const u64 *srcTick, int numDays)
Add an amount of days to a tick.
int sceRtcSetTick(ScePspDateTime *date, const u64 *tick)
Set a ScePspDateTime struct based on ticks.
int sceRtcSetTime_t(ScePspDateTime *date, const time_t time)
int sceRtcCheckValid(const ScePspDateTime *date)
Validate pspDate component ranges.
int sceRtcTickAddWeeks(u64 *destTick, const u64 *srcTick, int numWeeks)
Add an amount of weeks to a tick.
int sceRtcTickAddMicroseconds(u64 *destTick, const u64 *srcTick, u64 numMS)
Add an amount of ms to a tick.
int sceRtcSetWin32FileTime(ScePspDateTime *date, u64 *win32Time)
int sceRtcTickAddYears(u64 *destTick, const u64 *srcTick, int numYears)
Add an amount of years to a tick.
int sceRtcGetCurrentClock(ScePspDateTime *time, int tz)
Get current tick count, adjusted for local time zone.
int sceRtcGetCurrentClockLocalTime(ScePspDateTime *time)
Get current local time into a ScePspDateTime struct.
uint64_t u64
Definition psptypes.h:42
uint32_t u32
Definition psptypes.h:41
Definition psptypes.h:419