citadel
About: Citadel is an advanced messaging and collaboration system for groupware and BBS applications (preferred OS: Linux).
  Fossies Dox: citadel.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Loading...
Searching...
No Matches
default_timezone.c
Go to the documentation of this file.
1//
2// Copyright (c) 1987-2022 by the citadel.org team
3//
4// This program is open source software. Use, duplication, or disclosure
5// is subject to the terms of the GNU General Public License, version 3.
6
7#include "sysdep.h"
8#include <stdlib.h>
9#include <unistd.h>
10#include <sys/types.h>
11#include <limits.h>
12#include <stdio.h>
13#include <string.h>
14#include <strings.h>
15#include <syslog.h>
16#include <libical/ical.h>
17#include <libcitadel.h>
18#include "citadel.h"
19#include "server.h"
20#include "citserver.h"
21#include "sysdep_decls.h"
22#include "support.h"
23#include "config.h"
24#include "default_timezone.h"
25#include "ctdl_module.h"
26
27
28// Figure out which time zone needs to be used for timestamps that are
29// not UTC and do not have a time zone specified.
30icaltimezone *get_default_icaltimezone(void) {
31
32 icaltimezone *zone = NULL;
33 char *default_zone_name = CtdlGetConfigStr("c_default_cal_zone");
34
35 if (!zone) {
36 zone = icaltimezone_get_builtin_timezone(default_zone_name);
37 }
38 if (!zone) {
39 syslog(LOG_ERR, "ical: Unable to load '%s' time zone. Defaulting to UTC.", default_zone_name);
40 zone = icaltimezone_get_utc_timezone();
41 }
42 if (!zone) {
43 syslog(LOG_ERR, "ical: unable to load UTC time zone!");
44 }
45
46 return zone;
47}
char * CtdlGetConfigStr(char *key)
Definition: config.c:363
icaltimezone * get_default_icaltimezone(void)