1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-06 04:00:08 +00:00

Added time-of-day to Time::getCompilationDate()

This commit is contained in:
jules 2016-02-15 16:19:56 +00:00
parent d788e10eb4
commit 3aa68f3d00

View file

@ -442,19 +442,24 @@ static int getMonthNumberForCompileDate (const String& m) noexcept
if (m.equalsIgnoreCase (shortMonthNames[i]))
return i;
// If you hit this because your compiler has a non-standard __DATE__ format,
// let me know so we can add support for it!
// If you hit this because your compiler has an unusual __DATE__
// format, let us know so we can add support for it!
jassertfalse;
return 0;
}
Time Time::getCompilationDate()
{
StringArray dateTokens;
StringArray dateTokens, timeTokens;
dateTokens.addTokens (__DATE__, true);
dateTokens.removeEmptyStrings (true);
timeTokens.addTokens (__TIME__, ":", StringRef());
return Time (dateTokens[2].getIntValue(),
getMonthNumberForCompileDate (dateTokens[0]),
dateTokens[1].getIntValue(), 12, 0);
dateTokens[1].getIntValue(),
timeTokens[0].getIntValue(),
timeTokens[1].getIntValue());
}