Question - Days counting system on MySQL sistem. [REP ++ for the best answer]
#1

Hello guys , i want to make an age for my personal car sistem and i really don't have any ideea of how to stock the days , how to count them by using mysql .. If someone know how to do this, please reply with the script.
I appreciate all the answers.
Thanks. I Rep ++
Reply
#2

I'm not entirely sure where you want to go with this. You can save date and time either as a Unix timestamp or as a DateTime value. They can be converted into each other should the need arise, but the DateTime type has the advantage due the numerous functions that exist to manipulate these values, such as datediff().
Reply
#3

You can do something like this, maybe?

pawn Код:
public OnVehicleCreation(vehicleid)
{
    new day;
    Born[vehicleid] = getdate(day, day, day);
    return true;
}

stock GetCarAge(vehicleid)
{
    new tmpage, day;
    tmpage = Born[vehicleid] - getdate(day, day, day);
    return tmpage;
}
Something like this? Or, if it's purely MySQL then see event scheduling,
https://sampforum.blast.hk/showthread.php?pid=3258877#pid3258877
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)