SA-MP Forums Archive
Date in MYSQL Fetch and Insert - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Date in MYSQL Fetch and Insert (/showthread.php?tid=613814)



Date in MYSQL Fetch and Insert - ToiletDuck - 01.08.2016

Im really confused about this, is there anyway to store a Date that returns to a Timestamp? just like gettime in pawno instead using NOW()?
correct me if im wrong im not a pro.


Re: Date in MYSQL Fetch and Insert - [cS]Owain - 01.08.2016

PHP код:
select unix_timestamp(`dateColumnName`) as `timestampfrom tableName



Re: Date in MYSQL Fetch and Insert - Vince - 01.08.2016

A Unix timestamp can be stored in a normal int column. The function that returns the timestamp is called UNIX_TIMSTAMP().


Re: Date in MYSQL Fetch and Insert - ToiletDuck - 01.08.2016

Quote:
Originally Posted by Vince
Посмотреть сообщение
A Unix timestamp can be stored in a normal int column. The function that returns the timestamp is called UNIX_TIMSTAMP().
okay i'll try thanksss
Код:
code by [cS]Owain
select unix_timestamp(`dateColumnName`) as `timestamp` from tableName;
i'll use this to fetch unix_timestamp? this will return to timestamp right?

@EDIT:
Nevermind i'll do it in my own way >.>