diff options
Diffstat (limited to 'src/test/timezones.c')
-rw-r--r-- | src/test/timezones.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/test/timezones.c b/src/test/timezones.c index 935e912d..0285e3b5 100644 --- a/src/test/timezones.c +++ b/src/test/timezones.c @@ -1,18 +1,9 @@ /* ====================================================================== - (C) COPYRIGHT 2008, Eric Busboom <eric@civicknowledge.com> + SPDX-FileCopyrightText: 2008, Eric Busboom <eric@civicknowledge.com> - This library is free software; you can redistribute it and/or modify - it under the terms of either: - - The LGPL as published by the Free Software Foundation, version - 2.1, available at: https://www.gnu.org/licenses/lgpl-2.1.html - - Or: - - The Mozilla Public License Version 2.0. You may obtain a copy of - the License at https://www.mozilla.org/MPL/ + SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0 ======================================================================*/ @@ -39,9 +30,9 @@ int main() int verbose = 0; int day; - time_t start_time; + icaltime_t start_time; struct tm start_tm; - time_t curr_time; + icaltime_t curr_time; struct tm curr_tm; struct icaltimetype curr_tt; int failed = 0; @@ -82,19 +73,19 @@ int main() * determine current local time and date: always use midday in * the current zone and first day of first month in the year */ - start_time = time(NULL); - (void)localtime_r(&start_time, &start_tm); + start_time = icaltime(NULL); + (void)icallocaltime_r(&start_time, &start_tm); start_tm.tm_hour = 12; start_tm.tm_min = 0; start_tm.tm_sec = 0; start_tm.tm_mday = 1; start_tm.tm_mon = 0; - start_time = mktime(&start_tm); + start_time = icalmktime(&start_tm); /* check time conversion for the next 365 days */ for (day = 0, curr_time = start_time; day < 365; day++, curr_time += 24 * 60 * 60) { /* determine date/time with glibc */ - localtime_r(&curr_time, &curr_tm); + icallocaltime_r(&curr_time, &curr_tm); /* determine date/time with libical */ curr_tt = icaltime_from_timet_with_zone(curr_time, 0, utc_zone); curr_tt.zone = utc_zone; /* workaround: icaltime_from_timet_with_zone() @@ -114,7 +105,7 @@ int main() if (verbose || curr_failed != failed) { struct tm utc_tm; - if (!gmtime_r(&curr_time, &utc_tm)) + if (!icalgmtime_r(&curr_time, &utc_tm)) memset(&utc_tm, 0, sizeof(utc_tm)); printf( |