CRISIL interview question

How do segregate date time in sql