This function returns the day (from 1 to 31) of the given datetime.
date_get_day(date);
Real
myday = date_get_day( date_current_datetime() );
This would set "myday" to the current day.