Below is the instruction to compile the library with the example program titled classic test_1.c
:
gcc test_1.c ../WorldClockLib/dtFRMtz/dtFRMtz.c -o test_1
Below is an example of a minimal C program to use this library available in tests
:
#include <stdio.h>
#include <stdlib.h>
//
#include "../WorldClockLib/dtFRMtz/dtFRMtz.h"
//
int main() {
/*time_t timestampGetDateTime = getDateTime_Epoch("Africa/Algiers");
printf("Current UTC time is %s\n", ctime(×tampGetDateTime));*/
//
char* tz = malloc(30);
printf("Veuillez saisir le timezone que vous voulez : ");
scanf("%s", tz);
printf("\n");
//
printf("%s", tz);
//
struct tm *tmGetDateTime = getDateTime_Tm("Pacific/Marquesas");
printf("Current UTC time is %s\n", asctime(tmGetDateTime));
//
free(tz);
//
return 0;
}