Unity dateTeTime to String

DateTime dateTime = DateTime.Now;
string date = dateTime.ToString("yyyy-MM-dd");
string time = dateTime.ToString("HH:mm:ss");
IvanTroho