Files
amiga-tz/utility/dstcheck.c

35 lines
889 B
C
Raw Normal View History

2015-07-25 23:35:51 +02:00
//--------------------------------------------------------------------------//
// This file is in the public domain. //
//--------------------------------------------------------------------------//
2015-07-29 20:14:38 +02:00
2015-07-25 23:35:51 +02:00
#include <stdio.h>
#include <exec/execbase.h>
#include <exec/libraries.h>
#include "tzversion.h"
#include "clib/timezone.h"
#include "inline/timezone.h"
2015-07-29 20:14:38 +02:00
2015-07-25 23:35:51 +02:00
const char *vers = "\0$VER: DSTCheck" AMIGA_VERSION;
2015-07-29 20:14:38 +02:00
struct Library *TimezoneBase;
2015-07-25 23:35:51 +02:00
int main(const int argc, char *argv[])
{
int result;
struct tm tm;
time_t now ;
TimezoneBase = (struct Library*)OpenLibrary((STRPTR)"timezone.library", 0);
if (!TimezoneBase) {
printf("Cannot open timezone library.\n");
return 0;
}
now = time(NULL);
localtime_r(&now, &tm);
result = tm.tm_isdst ? 5 : 0;
CloseLibrary(TimezoneBase);
return result;
}