Skip to content

Instantly share code, notes, and snippets.

@sherief
Forked from 3735943886/EorzeaClock.c
Created August 4, 2023 17:27
Show Gist options
  • Save sherief/441799a417c66d847e17005c15532187 to your computer and use it in GitHub Desktop.
Save sherief/441799a417c66d847e17005c15532187 to your computer and use it in GitHub Desktop.
Get Eorzea Time
#include <stdio.h>
#include <time.h>
void GetEorzeaTime(int *eHour, int *eMin)
{
/* Get current time */
time_t currentTime;
time(&currentTime);
/* 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