05.02.2016, 06:24
PHP Code:
stock GetNulledTimeFormat()
{
new Year, Month, Day, Hour, Minute, Second;
new monthstr[11], daystr[11], hourstr[11], minutestr[11], secondstr[11], result[32];
getdate(Year, Month, Day); gettime(Hour, Minute, Second);
if(Day > 9){format(daystr,sizeof(daystr),"%d",Day);}
else if(Day < 10){format(daystr,sizeof(daystr),"0%d.",Day);}
if(Month > 9){format(monthstr,sizeof(monthstr),"%d.%d",Month,Year);}
else if(Month < 10){format(monthstr,sizeof(monthstr),"0%d.%d",Month,Year);}
if(Hour > 9){format(hourstr,sizeof(hourstr)," %d:",Hour);}
else if(Hour < 10){format(hourstr,sizeof(hourstr)," 0%d:",Hour);}
if(Minute > 9){format(minutestr,sizeof(minutestr),"%d:",Minute);}
else if(Minute < 10){format(minutestr,sizeof(minutestr),"0%d:",Minute);}
if(Second > 9){format(secondstr,sizeof(secondstr),"%d",Second);}
else if(Second < 10){format(secondstr,sizeof(secondstr),"0%d",Second);}
strcat(result, daystr); strcat(result, monthstr); strcat(result, hourstr);
strcat(result, minutestr); strcat(result, secondstr);
return result;
}
Code:
Will return something like | 05.02.2016 08:25:10