-snip-

[editline]9/15/2012[/editline] I was bored so I wrote this:

Maybe it’ll help with something. :L

[lua]local Debug = true;

function ConvertTime( t_Time, t_From, t_To )

```
local t_Conversions =
{
["Seconds"] = {
["Minutes"] = t_Time / 60,
["Hours"] = t_Time / 3600,
["Days"] = t_Time / 86400,
["Months"] = t_Time / 2628000,
["Years"] = t_Time / 31536000,
},
["Minutes"] = {
["Seconds"] = t_Time * 60,
["Hours"] = t_Time / 60,
["Days"] = t_Time / 1440,
["Months"] = t_Time / 43800,
["Years"] = t_Time / 525600
},
["Hours"] = {
["Seconds"] = t_Time * 3600,
["Minutes"] = t_Time * 60,
["Days"] = t_Time / 24,
["Months"] = t_Time / 730,
["Years"] = t_Time / 8760
},
["Days"] = {
["Seconds"] = t_Time * 86400,
["Minutes"] = t_Time * 1440,
["Hours"] = t_Time * 24,
["Months"] = t_Time / 30.4166666667,
["Years"] = t_Time / 365
},
["Months"] = {
["Seconds"] = t_Time * 2628000,
["Minutes"] = t_Time * 43800,
["Hours"] = t_Time * 730,
["Days"] = t_Time * 30.4166666667,
["Years"] = t_Time / 12
},
["Years"] = {
["Seconds"] = t_Time * 31536000,
["Minutes"] = t_Time * 525600,
["Hours"] = t_Time * 8760,
["Days"] = t_Time * 365,
["Months"] = t_Time * 12
};
};
----
-- math.Round( 10000 * Value ) / 10000;
--
-- The above is used to trim down a number.
--
-- From: 38.381666683
-- To: 38.3816
----
if ( Debug ) then
print( "Converting \"" .. t_Time .. "\" from \"" .. t_From .. "\" to \"" .. t_To .. "\"." );
end
return math.Round( 10000 * t_Conversions[ t_From or "Minute" ] [ t_To or "Hour" ] ) / 10000;
```

end[/lua]