[HELP] mysql saving date
#1

Hello how can I save date format in mysql like 07/06/2014 beacuse recenty I was trying to do and nothing I was set that to varchar in mysql table and from first somehow it won't work with this // and I was put llike %d%d%d day,month,year and then in mysql table last activity it was I think 2014-6-7 but I want 07/06/2014 if you know what I mean in that format I was trying everything but I didn't manage to work it out? Thanks
Reply
#2

I don't think it's possible, unless you use another field for each parameter.
Reply
#3

http://dev.mysql.com/doc/refman/5.5/...on_date-format

MySQL stores timestamps in its own specific format. There is no way to change the representation in the table, but frankly it doesn't matter. You convert the timestamp to the format you need, when you need it.
Reply
#4

but how then was in one field this 7-6-2014 but I want it 7/6/2014

edit: is it possible to edit the timestamp to format which I need I know use timestamp and goes like 2014-6-7 and there in that field also are time but I don't want that just date. Thanks
Reply
#5

PHP код:
select date_format('2014-6-7''%e/%c/%Y'
PHP код:
select date_format(yourDateField'%e/%c/%Y'from yourTable 
Note that you must escape the '%' symbols if you use them in a format statement in Pawn;

pawn Код:
format(query, sizeof(query), "select date_format(yourDateField, '%%e/%%c/%%Y') from yourTable where id = %d", playersqlid);
Reply
#6

where that is go and from your table are you mean on that variable on name of column which is lastactivity and is it a way to remove the time and just leave date.
Reply
#7

Why do I honestly still bother. Go and read that page I linked. There are a bunch of examples there. Or ask ******.
Reply
#8

I understand more or less how to do it just one more question is that select etc.. go under onplayerdisconnect
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)