//
// GameToolbox::timestampToHumanReadable from 0x2efc68 to 0x2efdee (390 bytes)
//
// 2 xrefs:
// > GJLevelList::showListInfo @ 0x3cde08
// > GJLevelList::showListInfo @ 0x3cde44
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
GameToolbox *__fastcall GameToolbox::timestampToHumanReadable(GameToolbox *this, time_t a2, int a3)
{
time_t v5; // r0
double v6; // r0
double v7; // d7
char *v8; // r2
_DWORD v10[3]; // [sp+0h] [bp-Ch] BYREF
v10[0] = this;
v10[1] = a2;
v10[2] = a3;
v5 = time(nullptr);
v6 = difftime(v5, a2);
v7 = v6;
if ( v6 >= 60.0 )
{
if ( v6 >= 3600.0 )
{
if ( v6 >= 86400.0 )
{
if ( v6 >= 2592000.0 )
{
if ( v6 >= 31536000.0 )
{
GameToolbox::intToString((GameToolbox *)v10, (int)(v6 / 31536000.0));
if ( (int)(v7 / 31536000.0) > 1 )
v8 = " years ago";
else
v8 = " year ago";
}
else
{
GameToolbox::intToString((GameToolbox *)v10, (int)(v6 / 2592000.0));
if ( (int)(v7 / 2592000.0) > 1 )
v8 = " months ago";
else
v8 = " month ago";
}
}
else
{
GameToolbox::intToString((GameToolbox *)v10, (int)(v6 / 86400.0));
if ( (int)(v7 / 86400.0) > 1 )
v8 = " days ago";
else
v8 = " day ago";
}
}
else
{
GameToolbox::intToString((GameToolbox *)v10, (int)(v6 / 3600.0));
if ( (int)(v7 / 3600.0) > 1 )
v8 = " hours ago";
else
v8 = " hour ago";
}
}
else
{
GameToolbox::intToString((GameToolbox *)v10, (int)(v6 / 60.0));
if ( (int)(v7 / 60.0) > 1 )
v8 = " minutes ago";
else
v8 = " minute ago";
}
std::operator+(this, (int)v10, v8);
sub_774008(v10);
}
else
{
sub_776584((int)this, "Less than 1 minute ago");
}
return this;
}