forked from mirrors/kolyah35-minecraft-pe-0.6.1
the whole game
This commit is contained in:
parent
816e9060b4
commit
f0617a5d22
2069 changed files with 581500 additions and 0 deletions
35
project/lib_projects/raknet/jni/RaknetSources/EpochTimeToString.cpp
Executable file
35
project/lib_projects/raknet/jni/RaknetSources/EpochTimeToString.cpp
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#include "FormatString.h"
|
||||
#include "EpochTimeToString.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
// localtime
|
||||
#include <time.h>
|
||||
#include "LinuxStrings.h"
|
||||
|
||||
char * EpochTimeToString(long long time)
|
||||
{
|
||||
static int textIndex=0;
|
||||
static char text[4][64];
|
||||
|
||||
if (++textIndex==4)
|
||||
textIndex=0;
|
||||
|
||||
struct tm * timeinfo;
|
||||
time_t t = time;
|
||||
timeinfo = localtime ( &t );
|
||||
strftime (text[textIndex],64,"%c.",timeinfo);
|
||||
|
||||
/*
|
||||
time_t
|
||||
// Copied from the docs
|
||||
struct tm *newtime;
|
||||
newtime = _localtime64(& time);
|
||||
asctime_s( text[textIndex], sizeof(text[textIndex]), newtime );
|
||||
|
||||
while (text[textIndex][0] && (text[textIndex][strlen(text[textIndex])-1]=='\n' || text[textIndex][strlen(text[textIndex])-1]=='\r'))
|
||||
text[textIndex][strlen(text[textIndex])-1]=0;
|
||||
*/
|
||||
|
||||
return text[textIndex];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue