From f2254f0444c3f18957fb86f8825e88a0e5983776 Mon Sep 17 00:00:00 2001 From: Benson Muite Date: Sun, 22 Jun 2025 10:47:15 +0300 Subject: [PATCH] Use UTC instead of GMT UTC is the current standard. --- USAGE.txt | 6 +++--- sunwait.c | 12 ++++++------ sunwait.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/USAGE.txt b/USAGE.txt index 2204431..5e9cfa6 100644 --- a/USAGE.txt +++ b/USAGE.txt @@ -2,7 +2,7 @@ Calculate sunrise and sunset times for the current or targetted day. The times can be adjusted either for twilight or fixed durations. The program can either: wait for sunrise or sunset (function: wait), - or return the time (GMT or local) the event occurs (function: list), + or return the time (UTC or local) the event occurs (function: list), or report the day length and twilight timings (function: report), or simply report if it is DAY or NIGHT (function: poll). @@ -21,7 +21,7 @@ Minor options, any of: [no]debug Print extra info and returns in one minute. Default: nodebug. [no]version Print the version number. Default: noversion. [no]help Print this help. Default: nohelp. - [no]gmt Print times in GMT or local-time. Default: nogmt. + [no]gmt Print times in UTC or local-time. Default: nogmt. Twilight types, either: daylight Top of sun just below the horizon. Default. @@ -61,7 +61,7 @@ Indicate by program exit-code if is Day or Night using a custom twilight angle o Example 4: sunwait list 7 gmt sunrise angle 3 List next 7 days sunrise times, custom +3 degree twilight angle, default location. -Uses GMT; as any change in daylight saving over the specified period is not considered. +Uses UTC; as any change in daylight saving over the specified period is not considered. Example 5: sunwait report y 20 m 3 d 15 10.49S 105.55E Produce a report of the different sunrises and sunsets on an arbitrary day (2022/03/15) for an arbitrary location (Christmas Island) diff --git a/sunwait.c b/sunwait.c index 8cb9fb8..6ac707b 100755 --- a/sunwait.c +++ b/sunwait.c @@ -89,7 +89,7 @@ static void print_usage () printf ("The times can be adjusted either for twilight or fixed durations.\n"); printf ("\n"); printf ("The program can either: wait for sunrise or sunset (function: wait),\n"); - printf (" or return the time (GMT or local) the event occurs (function: list),\n"); + printf (" or return the time (UTC or local) the event occurs (function: list),\n"); printf (" or report the day length and twilight timings (function: report),\n"); printf (" or simply report if it is DAY or NIGHT (function: poll).\n"); printf ("\n"); @@ -108,7 +108,7 @@ static void print_usage () printf (" [no]debug Print extra info and returns in one minute. Default: nodebug.\n"); printf (" [no]version Print the version number. Default: noversion.\n"); printf (" [no]help Print this help. Default: nohelp.\n"); - printf (" [no]gmt Print times in GMT or local-time. Default: nogmt.\n"); + printf (" [no]utc Print times in UTC or local-time. Default: noutc.\n"); printf ("\n"); printf ("Twilight types, either:\n"); printf (" daylight Top of sun just below the horizon. Default.\n"); @@ -146,9 +146,9 @@ static void print_usage () printf ("Example 3: sunwait poll exit angle 10 54.897786N -1.517536E\n"); printf ("Indicate by program exit-code if is Day or Night using a custom twilight angle of 10 degrees above horizon. Washington, UK.\n"); printf ("\n"); - printf ("Example 4: sunwait list 7 gmt sunrise angle 3\n"); + printf ("Example 4: sunwait list 7 UTC sunrise angle 3\n"); printf ("List next 7 days sunrise times, custom +3 degree twilight angle, default location.\n"); - printf ("Uses GMT; as any change in daylight saving over the specified period is not considered.\n"); + printf ("Uses UTC; as any change in daylight saving over the specified period is not considered.\n"); printf ("\n"); printf ("Note that program uses C library functions to determine time and localtime.\n"); printf ("Error for timings are estimated at: +/- 4 minutes.\n"); @@ -350,7 +350,7 @@ static bool isOffset (runStruct *pRun, const char *pArg) } /* -** time_t converted to struct tm. Using GMT (UTC) time. +** time_t converted to struct tm. Using UTC time. */ void myUtcTime (const time_t *pTimet, struct tm *pTm) { @@ -609,7 +609,7 @@ int main (int argc, char *argv[]) // Minor Options - // Print output in GMT or local-time + // Print output in UTC or local-time else if (!strcmp (arg, "gmt") || !strcmp (arg, "utc")) pRun->utc = ONOFF_ON; else if (!strcmp (arg, "nogmt") || diff --git a/sunwait.h b/sunwait.h index 4b979b6..adcb04d 100755 --- a/sunwait.h +++ b/sunwait.h @@ -45,7 +45,7 @@ typedef struct OnOff functionPoll; // User wants a "NIGHT" or "DAY" return code/text OnOff functionWait; // User wants the program to wait until sunrise or sunset - OnOff utc; // Printed output is in GMT/UTC (on) or localtime (off) + OnOff utc; // Printed output is in UTC (on) or localtime (off) OnOff debug; // Is debug output required OnOff reportSunrise; // Report sun rising