Last active
August 4, 2023 17:27
-
-
Save 3735943886/d8a4da8f943ea49224aee87da41cfa88 to your computer and use it in GitHub Desktop.
Get Eorzea Time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <time.h> | |
void GetEorzeaTime(int *eHour, int *eMin) | |
{ | |
/* Get current time */ | |
time_t currentTime; | |
time(¤tTime); | |
/* Convert to Eorzea time */ | |
/* In Eorzea, 12 game minutes = 35 real seconds */ | |
if (eMin) *eMin = (currentTime * 12 / 35) % 60; | |
if (eHour) *eHour = (currentTime * 12 / 35 / 60) % 24; | |
return; | |
} | |
/* | |
void main() | |
{ | |
int hours, minutes; | |
GetEorzeaTime(&hours, &minutes); | |
printf("Eorzea Time %02d:%02d", hours, minutes); | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment