[HELP] date mysql saving format type
#1

Hello is there any way to save date when player disconnect in format like 13/07/2014? Thanks
Reply
#2

Yes there is.

Use the TimeStampToDate include!
Reply
#3

I try it but it didn't work . Thanks
Reply
#4

Use Unix timestamps or a datetime field. I think it's fairly stupid to use a bloated Pawn function while all the functionality you could possibly ever need is built right into MySQL.
Reply
#5

Pack it as string. Try this:

Код:
new y, m, d, string[20];
getdate(y, m, d);
format(string, 20, "%02d/%02d/%04d", d, m, y);
Reply
#6

can you maybe explain a little about datetime field can there put a format like 13/07/2014 or? I currently have unixtimestamp in column so it show me a date in format 2014-7-13 and then a time but I don't need that just date and if it possible in format above this text? Thanks
Reply
#7

There are multiple built in function to convert date and time. A Unix timestamp saves both date and time in one normal integer variable. I think I've linked these article to you before;
http://dev.mysql.com/doc/refman/5.0/..._from-unixtime
http://dev.mysql.com/doc/refman/5.0/...on_date-format

I suggest you take a long look at these examples, because I can't really explain it better than they already did.
Reply
#8

I don't understand so much there. How that is look in gamemode or it should be in gamemode I try few times but with no succes? Thaks
Reply
#9

new Year, Month, Day;
getdate(Year, Month, Day);
new query[500],pNameg[24];
GetPlayerName(playerid,pNameg,sizeof(pNameg));
format(query,sizeof(query),"UPDATE `vartotojai` SET prisijungimas='%i-%i-%i' WHERE (`Vardas` = '%s')",Day,Month,Year,pNameg);
mysql_query(query);
Reply
#10

I try that but it doesn't work. Thanks. Anyone else?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)