SA-MP Forums Archive
Any way to convert DATE to UNIX Timestamp ? - 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: Any way to convert DATE to UNIX Timestamp ? (/showthread.php?tid=577962)



Any way to convert DATE to UNIX Timestamp ? - NeroX98 - 15.06.2015

Hello scripterzzz !

I'm trying to make registration system, so i need the players to write their birth date in the following format DD/MM/YY and then convert it to Unix timestamp and save it on my MySQL database.
So is there any chance to convert date to Unix timestamp ?


Re: Any way to convert DATE to UNIX Timestamp ? - Konstantinos - 15.06.2015

https://dev.mysql.com/doc/refman/5.1...unix-timestamp


Re : Any way to convert DATE to UNIX Timestamp ? - Dutheil - 15.06.2015

Hi NeroX98 you can use this include : https://sampforum.blast.hk/showthread.php?tid=347605
Use the function DateToTimestamp and edit the splitter at the line 14.

PHP код:
#define SPLITTER . 
to:
PHP код:
#define SPLITTER / 
As against the year is done in 4 digits.

Konstantinos : I think this is not what he wanted. (One Piece ♥)


Re: Any way to convert DATE to UNIX Timestamp ? - NeroX98 - 15.06.2015

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Thank you... REP+

Quote:
Originally Posted by Dutheil
Посмотреть сообщение
Hi NeroX98 you can use this include : https://sampforum.blast.hk/showthread.php?tid=347605
Use the function DateToTimestamp and edit the splitter at the line 14.

PHP код:
#define SPLITTER . 
to:
PHP код:
#define SPLITTER / 
As against the year is done in 4 digits.

Konstantinos : I think this is not what he wanted. (One Piece ♥)
The include isn't very effecient as the MySQL function but if i fail to fix the problem with the MySQL i will try this
Thank you, REP+