mirror of
https://ranger.innolan.net/rainlance/AmiTimeKeeper.git
synced 2025-10-07 12:43:00 +00:00
Release 1.11
This commit is contained in:
@@ -95,7 +95,7 @@ void CloseAppLocale(struct AppLocale *lc)
|
||||
FreeMemSafe(lc);
|
||||
}
|
||||
|
||||
void GetTimezoneText(struct AppLocale *loc, char *text, long parens)
|
||||
void GetTimezoneText(struct AppLocale *loc, char *text, long opt)
|
||||
{
|
||||
if (loc == NULL || text == NULL)
|
||||
{
|
||||
@@ -106,30 +106,38 @@ void GetTimezoneText(struct AppLocale *loc, char *text, long parens)
|
||||
{
|
||||
long hoursOffset = (loc->AmigaLocale->loc_GMTOffset / -60L);
|
||||
long minutsOffset = (loc->AmigaLocale->loc_GMTOffset % -60L);
|
||||
SNPrintf(text, TIMEZONE_TEXT_LEN, "UTC%s%02ld:%02ld",
|
||||
(loc->AmigaLocale->loc_GMTOffset < 0L) ? "+" : "",
|
||||
hoursOffset,
|
||||
minutsOffset);
|
||||
SNPrintf(text, TIMEZONE_TEXT_LEN, "%s%s%02ld:%02ld",
|
||||
(opt == UTC_NO_PARENS) ? "UTC" : "GMT",
|
||||
(loc->AmigaLocale->loc_GMTOffset < 0L) ? "+" : "",
|
||||
hoursOffset,
|
||||
minutsOffset);
|
||||
}
|
||||
else if (parens == ZONE_IN_PARENS)
|
||||
else if (opt == ZONE_IN_PARENS)
|
||||
{
|
||||
SNPrintf(text, TIMEZONE_TEXT_LEN, "UTC%s%02ld:%02ld (%s)",
|
||||
PosixTimezoneSignChar(&Timezone->current),
|
||||
Timezone->current.offset.hours,
|
||||
Timezone->current.offset.minutes,
|
||||
Timezone->current.abbreviation);
|
||||
SNPrintf(text, TIMEZONE_TEXT_LEN, "GMT%s%02d:%02d (%s)",
|
||||
PosixTimezoneSignChar(&Timezone->current),
|
||||
Timezone->current.offset.hours,
|
||||
Timezone->current.offset.minutes,
|
||||
Timezone->current.abbreviation);
|
||||
}
|
||||
else if (parens == OFFSET_IN_PARENS)
|
||||
else if (opt == OFFSET_IN_PARENS)
|
||||
{
|
||||
SNPrintf(text, TIMEZONE_TEXT_LEN, "%s (UTC%s%02ld:%02ld)",
|
||||
Timezone->current.abbreviation,
|
||||
PosixTimezoneSignChar(&Timezone->current),
|
||||
Timezone->current.offset.hours,
|
||||
Timezone->current.offset.minutes);
|
||||
SNPrintf(text, TIMEZONE_TEXT_LEN, "%s (GMT%s%02d:%02d)",
|
||||
Timezone->current.abbreviation,
|
||||
PosixTimezoneSignChar(&Timezone->current),
|
||||
Timezone->current.offset.hours,
|
||||
Timezone->current.offset.minutes);
|
||||
}
|
||||
else if (opt == UTC_NO_PARENS)
|
||||
{
|
||||
SNPrintf(text, TIMEZONE_TEXT_LEN, "UTC%s%02d:%02d",
|
||||
PosixTimezoneSignChar(&Timezone->current),
|
||||
Timezone->current.offset.hours,
|
||||
Timezone->current.offset.minutes);
|
||||
}
|
||||
}
|
||||
|
||||
char* GetTimeText(struct AppLocale *loc, ULONG time)
|
||||
char *GetTimeText(struct AppLocale *loc, ULONG time)
|
||||
{
|
||||
char *out;
|
||||
struct ClockData cd;
|
||||
@@ -156,28 +164,28 @@ char* GetTimeText(struct AppLocale *loc, ULONG time)
|
||||
long minutsOffset = (loc->AmigaLocale->loc_GMTOffset % -60L);
|
||||
|
||||
SNPrintf(out, 128, "%s %02ld %s %02ld:%02ld:%02ld%s%02ld%02ld %ld",
|
||||
loc->weekday[cd.wday],
|
||||
(long)cd.mday,
|
||||
loc->month[cd.month - 1],
|
||||
(long)cd.hour,
|
||||
(long)cd.min,
|
||||
(long)cd.sec,
|
||||
(loc->AmigaLocale->loc_GMTOffset < 0L) ? "+" : "",
|
||||
hoursOffset,
|
||||
minutsOffset,
|
||||
(long)cd.year);
|
||||
loc->weekday[cd.wday],
|
||||
(long)cd.mday,
|
||||
loc->month[cd.month - 1],
|
||||
(long)cd.hour,
|
||||
(long)cd.min,
|
||||
(long)cd.sec,
|
||||
(loc->AmigaLocale->loc_GMTOffset < 0L) ? "+" : "",
|
||||
hoursOffset,
|
||||
minutsOffset,
|
||||
(long)cd.year);
|
||||
}
|
||||
else
|
||||
{
|
||||
SNPrintf(out, 128, "%s %02ld %s %02ld:%02ld:%02ld %s %ld",
|
||||
loc->weekday[cd.wday],
|
||||
(long)cd.mday,
|
||||
loc->month[cd.month - 1],
|
||||
(long)cd.hour,
|
||||
(long)cd.min,
|
||||
(long)cd.sec,
|
||||
Timezone->current.abbreviation,
|
||||
(long)cd.year);
|
||||
loc->weekday[cd.wday],
|
||||
(long)cd.mday,
|
||||
loc->month[cd.month - 1],
|
||||
(long)cd.hour,
|
||||
(long)cd.min,
|
||||
(long)cd.sec,
|
||||
Timezone->current.abbreviation,
|
||||
(long)cd.year);
|
||||
}
|
||||
|
||||
return out;
|
||||
|
||||
Reference in New Issue
Block a user