Mysql Date
#1

How do i save date in mysql, i am using NOW() but how should i load these? in strings or integer and how could like
NOW()+days so it should save like
if it's 2015-07-01
so +7 days
2015-07-08
Reply
#2

This is most likely the best solution: [Tutorial] How to: Unix timestamps

Unix timestamps (the kind used by sa-mp) are in seconds, easy to save/load, and you could just add 604800 seconds (7 days) to have a timestamp for a week in the future. If you dont feel like reading the tut.

Once you are using timestamps, you can turn the database column into a timestamp type if you plan on doing fancy stuff with the data outside of sa-mp, or just int will work too, and in sa-mp read it as integer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)