KKT Optimality Conditions and Nonsmooth Continuous Time Optimization Problems