#include <vxWorks.h>
#include <envLib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <epicsTime.h>
Go to the source code of this file.
Definition at line 158 of file tz2timezone.c.
160 const char *tz = getenv(
"TZ");
167 char start[10], stop[10];
168 int hours = 0, minutes = 0, sign = 1;
187 if ((!tz) || (strlen(tz) < 3))
196 while ((i <
sizeof(zone) - 1) && isalpha((
int) *tz)) {
211 else if (*tz ==
'+') {
216 if (!isdigit((
int) *tz))
220 tz = getTime(tz, &hours);
226 if (!isdigit((
int) *++tz))
230 tz = getTime(tz, &minutes);
237 tz = getTime(tz + 1, &seconds);
242 if (isalpha((
int) *tz)) {
245 while ((i <
sizeof(zone) - 1) && isalpha((
int) *tz)) {
251 minutes += hours * 60;
255 tz = strchr(tz,
',');
258 sprintf(timezone,
"TIMEZONE=%s::%d", zone, minutes);
261 if (extractDate(tz, ¤t, start) != OK)
264 tz = strchr(tz + 1,
',');
267 if (extractDate(tz, ¤t, stop) != OK)
271 sprintf(timezone,
"TIMEZONE=%s::%d:%s:%s", zone, minutes, start, stop);
int epicsStdCall epicsTimeGetCurrent(epicsTimeStamp *pDest)
Get current time into *pDest.
EPICS time stamp, for use from C code.
LIBCOM_API int epicsStdCall epicsTimeToTM(struct tm *pDest, unsigned long *pNSecDest, const epicsTimeStamp *pSrc)
Convert epicsTimeStamp to struct tm in local time zone.