09.10.2011, 05:07
(
Последний раз редактировалось Jovanny; 09.10.2011 в 19:03.
Причина: Post updated!
)
strftime
Well, I'm starting in c + + plugin that I made this little function based on C + + strftimeWhy is it called strftime?
This means that you give the format you want at the time, this has a similar use ah
pawn Код:
format
EDIT: If the especifier does not exist crash the server!!
Examples:
Example #1
pawn Код:
#include <strftime>
public OnFilterScriptInit()
{
new time[20];
strftime("%I:%M %p",time);
print(time);
return 1;
}
Код:
10:05 PM
pawn Код:
#include <strftime>
public OnFilterScriptInit()
{
new time[20];
strftime("%I:%M:%S %p",time);
print(tiempo);
return 1;
}
Код:
10:05:43 PM
pawn Код:
#include <strftime>
public OnFilterScriptInit()
{
new time[20];
strftime("%p",time);
print(time);
return 1;
}
Код:
PM
Код:
%a - Abbreviated weekday name %A - Full weekday name %b - Abbreviated month name %B - Full month name %c - Date and time representation %d - Day of the month (01-31) %H - Hour in 24h format (00-23) %I - Hour in 12h format (01-12) %j - Day of the year (001-366) %m - Month as a decimal number (01-12) %M - Minute (00-59) %p - AM or PM designation %S - Second (00-61) %U - Week number with the first Sunday as the first day of week one (00-53) %w - Weekday as a decimal number with Sunday as 0 (0-6) %W - Week number with the first Monday as the first day of week one (00-53) %x - Date representation %X - Time representation %y - Year, last two digits (00-99) %Y - Year %Z - Timezone name or abbreviation %% - A % sign
Thanks to CyNiC for compile the plugin to linux version
Credits: Josta ( Create the plugin)
Credits: the_chaoz ( helpme whit c++)
Note: Sorry for my bad English, use a translator