ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
timezone.c File Reference
#include <time.h>
#include <sys/_tz_structs.h>
#include <stdio.h>
#include <stdlib.h>
#include "osd_config.h"
+ Include dependency graph for timezone.c:

Go to the source code of this file.

Macros

#define OSD_CONFIG_NO_LIBCDVD
 

Functions

void _ps2sdk_timezone_update ()
 

Variables

static char _ps2sdk_tzname [15]
 

Detailed Description

Set timezone-related variables based on the OSD configuration.

Definition in file timezone.c.

Macro Definition Documentation

◆ OSD_CONFIG_NO_LIBCDVD

#define OSD_CONFIG_NO_LIBCDVD

Definition at line 20 of file timezone.c.

Function Documentation

◆ _ps2sdk_timezone_update()

void _ps2sdk_timezone_update ( )

Definition at line 26 of file timezone.c.

27 {
28  // Set TZ and call tzset to ensure that timezone information won't get overwritten when tszet is called multiple times
29  setenv("TZ", "", 0);
30  tzset();
31 
32  __tzinfo_type *tz = __gettzinfo();
33 
34  // _timezone is in seconds, while the return value of configGetTimezone is in minutes
35  // Add one hour if configIsDaylightSavingEnabled is 1
36  _timezone = (configGetTimezone() + (configIsDaylightSavingEnabled() * 60)) * 60;
37  tz->__tzrule[0].offset = _timezone;
38  snprintf(_ps2sdk_tzname, sizeof(_ps2sdk_tzname), "Etc/GMT%+ld", _timezone / 3600);
39  _tzname[0] = _ps2sdk_tzname;
40  _tzname[1] = _ps2sdk_tzname;
41 
42  // Don't perform DST conversion
43  _daylight = 0;
44 }
int configGetTimezone(void)
int configIsDaylightSavingEnabled(void)
static char _ps2sdk_tzname[15]
Definition: timezone.c:23

References _ps2sdk_tzname, configGetTimezone(), and configIsDaylightSavingEnabled().

Variable Documentation

◆ _ps2sdk_tzname

char _ps2sdk_tzname[15]
static

Definition at line 23 of file timezone.c.

Referenced by _ps2sdk_timezone_update().