View Single Post
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 06-17-2014 , 14:06   Re: [SQL] Select CURDATE and format it
Reply With Quote #2

Your code is completely insane, I'll therefore skip the suggestions.
This should be what you want
PHP Code:
SELECT DATE_FORMAT(CURRENT_DATE(), '%Y%d%m'currentDate 
If you just want the current day of the month, this should do
PHP Code:
SELECT DAY(CURRENT_DATE()) AS currentDay 
I just want to remind you that you don't really have to use your database to get the current day.

This is one way to get the current day in sourcepawn
PHP Code:
decl String:sTime[3];
FormatTime(sTimesizeof(sTime), "%d");
new 
currentDay StringToInt(sTime); 
__________________

Last edited by Impact123; 06-17-2014 at 14:19.
Impact123 is offline