This function returns the second of the given datetime value.
date_get_second(date);
Real
mysecond = date_get_second(date_current_datetime());
This would set mysecond to the current second.