NetBurner 3.5.6
PDF Version
TimeZoneRecord Struct Reference

Time zone record structure containing complete time zone information. More...

#include <timezones.h>

Public Attributes

const char * Posix
 POSIX-compliant time zone string.
 
const char * Description
 Human-readable time zone description.
 
const char * Name
 Formal time zone name.
 
const char * Short_name
 Abbreviated time zone name.
 
int bUsCanada
 US/Canada time zone flag.
 

Detailed Description

Time zone record structure containing complete time zone information.

This structure defines a time zone with all necessary information for proper time conversion and display. The NetBurner system provides an array of over 75 pre-configured time zones covering all major regions worldwide.

The POSIX timezone string format is:

std offset[dst[offset][,start[/time],end[/time]]]
time_t time(time_t *pt)
Gets the current system GMT time.

Where:

  • std = Standard time zone abbreviation (e.g., "PST", "CET")
  • offset = Hours offset from UTC (e.g., "8" for PST = UTC-8)
  • dst = Daylight saving time abbreviation (e.g., "PDT", "CEST")
  • start = DST start rule (e.g., "M3.2.0" = 2nd Sunday in March)
  • end = DST end rule (e.g., "M11.1.0" = 1st Sunday in November)
Note
All time zone records are defined as const data in timezones.cpp
Example Time Zone Records:
// Pacific Time (US West Coast)
{"PST8PDT,M3.2.0,M11.1.0",
"(GMT-08:00) Pacific Time (US and Canada); Tijuana",
"Pacific Standard Time",
"PST ",
1}
// Central European Time
{"CET-1CEST,M3.5.0,M10.5.0/3",
"(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",
"W. Europe Standard Time",
"CET ",
0}
// Japan (no DST)
{"JST-9",
"(GMT+09:00) Osaka, Sapporo, Tokyo",
"Tokyo Standard Time",
"JST ",
0}
Usage Example:
#include <timezones.h>
#include <ntp.h>
void SetupTimeZone() {
// Search for Pacific Time zone
while (tz->Posix != NULL) {
if (strstr(tz->Description, "Pacific Time") != NULL) {
// Set the system time zone
tzset(tz->Posix);
iprintf("Set timezone to: %s\r\n", tz->Description);
break;
}
tz++;
}
}
const TimeZoneRecord * TZRecords
Global array of time zone records.
Time zone record structure containing complete time zone information.
Definition timezones.h:113
const char * Posix
POSIX-compliant time zone string.
Definition timezones.h:129
const char * Description
Human-readable time zone description.
Definition timezones.h:145

Member Data Documentation

◆ bUsCanada

int TimeZoneRecord::bUsCanada

US/Canada time zone flag.

Indicates whether this time zone is used in the United States and/or Canada. This flag can be used to filter time zones by region or to apply region-specific time zone selection logic.

Returns
  • 1: Time zone is used in US and/or Canada
  • 0: Time zone is used elsewhere (Europe, Asia, etc.)
Note
Some time zones span multiple regions. This flag indicates primary usage region.

◆ Description

const char* TimeZoneRecord::Description

Human-readable time zone description.

A descriptive string that includes the GMT offset and major cities or regions in the time zone. This is useful for displaying time zone selections to users.

Format: "(GMT +/- HH:MM) City/Region descriptions"

Examples:

  • "(GMT-08:00) Pacific Time (US and Canada); Tijuana"
  • "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"
  • "(GMT+09:00) Osaka, Sapporo, Tokyo"

◆ Name

const char* TimeZoneRecord::Name

Formal time zone name.

The official or formal name of the time zone, often matching Windows time zone names for compatibility. Used for documentation and display.

Examples:

  • "Pacific Standard Time"
  • "W. Europe Standard Time"
  • "Tokyo Standard Time"

◆ Posix

const char* TimeZoneRecord::Posix

POSIX-compliant time zone string.

The POSIX timezone string defines the time zone offset from UTC and optional daylight saving time rules. This string is used with the standard tzset() function to configure the system's time zone.

Format examples:

  • "PST8PDT,M3.2.0,M11.1.0" - Pacific Time with DST
  • "CET-1CEST,M3.5.0,M10.5.0/3" - Central European Time with DST
  • "JST-9" - Japan Standard Time (no DST)
  • "UTC0" - Coordinated Universal Time
Note
Negative offsets indicate zones west of UTC, positive east of UTC

◆ Short_name

const char* TimeZoneRecord::Short_name

Abbreviated time zone name.

A short 3-6 character abbreviation for the standard time zone name. This is typically the standard time abbreviation (not DST). Padded with spaces to 6 characters for alignment.

Examples:

  • "PST " (Pacific Standard Time)
  • "CET " (Central European Time)
  • "JST " (Japan Standard Time)
  • "UTC " (Coordinated Universal Time)

The documentation for this struct was generated from the following file: