Files
BlitzSteam/Helpers/Helper.cpp
T

28 lines
1.1 KiB
C++
Raw Normal View History

// BlitzSteam - Steam wrapper for Blitz
2016-01-11 16:56:07 +01:00
// Copyright (C) 2015 Xaymar (Michael Fabian Dirks)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2016-02-06 00:17:29 +01:00
#include "Helper.h"
2015-05-17 12:45:11 +02:00
2016-02-06 00:17:29 +01:00
DLL_FUNCTION(const char*) BS_Helper_FormatUnixTime(uint32_t unTime, const char* pchFormat) {
char* output = new char[strlen(pchFormat) * 4];
time_t t = unTime;
struct tm *tm = localtime(&t);
strftime(output, sizeof(output), pchFormat, tm);
delete tm;
return output;
}
#pragma comment(linker, "/EXPORT:BS_Helper_FormatUnixTime=_BS_Helper_FormatUnixTime@8")