[HELP] GetDate
#1

How can i change the month?... now it says, 10.12.2010 but i want it to say 10.december[12].2010

pawn Code:
public OnPlayerConnect(playerid)
{
    new string[64];
    new Year, Month, Day;
    getdate(Year, Month, Day);
    format(string, sizeof(string), "%02d.%02d.%d", Day, Month, Year);
    SendClientMessageToAll(COLOR_RED, string);
    return 1;
}
Reply
#2

pawn Code:
stock GetMonth(Month)
{
    new MonthStr[15];
    switch(Month)
    {
        case 1:  MonthStr = "January";
        case 2:  MonthStr = "February";
        case 3:  MonthStr = "March";
        case 4:  MonthStr = "April";
        case 5:  MonthStr = "May";
        case 6:  MonthStr = "June";
        case 7:  MonthStr = "July";
        case 8:  MonthStr = "August";
        case 9:  MonthStr = "September";
        case 10: MonthStr = "October";
        case 11: MonthStr = "November";
        case 12: MonthStr = "December";
    }
    return MonthStr;
}
pawn Code:
public OnPlayerConnect(playerid)
{
    new string[64];
    new Year, Month, Day;
    getdate(Year, Month, Day);
    format(string, sizeof(string), "%02d.%s[%02d].%d", Day, GetMonth(Month), Month, Year);
    SendClientMessageToAll(COLOR_RED, string);
    return 1;
}
Reply
#3

Thank you
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)