01.07.2012, 21:32
Hello!
I'm making my ban command and auto detecting if they are unbanned date.
so I wonder how to get a date such as '2012-02-23' into integers year = 2012, month = 2, day = 23
I've got an idea on strcmp to compare if there are any numbers inside there wich is a date and in some way convert them to integers, but this shoud take some work as i would need to check for every single number that can be in there.
So is there any way to get this to work?
The compare thing i use is i get the date and for every year i * 365, month*30 and then add it all together with the day and i should do this with the mysql saved date to.
Or is there any function to compare 2 dates?
Sorry if you don't understand, just ask and I'll try to explain.
I'm thankfull for every answer i get
I'm making my ban command and auto detecting if they are unbanned date.
so I wonder how to get a date such as '2012-02-23' into integers year = 2012, month = 2, day = 23
I've got an idea on strcmp to compare if there are any numbers inside there wich is a date and in some way convert them to integers, but this shoud take some work as i would need to check for every single number that can be in there.
So is there any way to get this to work?
The compare thing i use is i get the date and for every year i * 365, month*30 and then add it all together with the day and i should do this with the mysql saved date to.
Or is there any function to compare 2 dates?
Sorry if you don't understand, just ask and I'll try to explain.
I'm thankfull for every answer i get