how to get the format time like "2005-06-20"

Ethan Tu
2005-06-20T08:42:06Z

In the kernel, how to get the format time like "2005-06-20" ?thanks!
--
I am real me!