22.07.2008, 06:53
StrGetTime
This functions returns the numeric time as string.
StrGetDate
This functions can return the current date in different english styles as string.

StrGetDate( 1 ) will return "July 22, 2008" today.
I'd put the months array at the Global variables.
This functions returns the numeric time as string.
pawn Код:
StrGetTime( )
{
new
string[ 9 ],
hours,
minutes,
seconds;
gettime( hours , minutes , seconds );
format( string , sizeof( string ) , "%d:%02d:%02d" , hours , minutes , seconds );
return string;
}
This functions can return the current date in different english styles as string.

StrGetDate( 1 ) will return "July 22, 2008" today.
I'd put the months array at the Global variables.
pawn Код:
new months[ 12 ] [ 10 ] = {
{ "January" }, { "February" }, { "March" }, { "April" }, { "May" }, { "June" },
{ "July" }, { "August" }, { "September" }, { "October" }, { "November" }, { "December" }
};
pawn Код:
StrGetDate( type )
{
new
string[ 16 ],
year,
stryear[ 4 ],
month,
day;
getdate( year , month , day );
switch( type )
{
case 0 : // 10 July 1994
format( string , sizeof( string ) , "%02d %s %d" , day , months[ month -1 ] , year );
case 1 : // July 10, 1994
format( string , sizeof( string ) , "%s %02d, %d" , months[ month -1 ] , day , year );
case 2 : // 10 07 1994
format( string , sizeof( string ) , "%02d %02d %d" , day , month , year );
case 3 : // 10.07.1994
format( string , sizeof( string ) , "%02d.%02d.%d" , day , month , year );
case 4 : // 10.7.1994
format( string , sizeof( string ) , "%d.%d.%d" , day , month , year );
case 5 : // 10 07 94
{
valstr( stryear , year );
format( string , sizeof( string ) , "%02d %02d %2s" , day , month , stryear[ 2 ] );
}
case 6 : // 10.7.94
{
valstr( stryear , year );
format( string , sizeof( string ) , "%d.%d.%2s" , day , month , stryear[ 2 ] );
}
}
return string;
}

