You can't: DateTime values don't have a format, they are stored as a number of ticks since a specific moment in time. They only acquire a format of any kind when they are converted to strings for presentation to the user in some way - and then the format would normally depend on the users own preferences, not on yours!
You can format a DateTime to year-month-day very simply when you need to show it, but you can't "associate" any format with a DateTime value.
string formatted = myDateTime.ToString("yyyy-MM-dd");
Formatting a DateTime for display - format string description[
^]