C# C# Streams and Data Processing Streaming Data on the Net Deserialize the News Results

Can't Format date and time for the quizzes.

I've watched the video of her putting in the Date and Time formats according to the MSDN website a million times, but I'm not understanding the format of how she's doing it versus the format the quiz question wants.

I've tried:

{0:d} {0:D}

2 Answers

Jennifer Nordell
STAFF
Jennifer Nordell
Treehouse Staff

Hi there! You're really close, but my guess is that you're misunderstanding the question (at least if we're talking about the one that is asking you to change the format of the date). Here's part of the instructions:

" current date and time, but formatted as a full date/time pattern (short time) "

And if you look at the MSDN (which you've obviously done), I don't think you read down quite far enough. The "d" is used for "Short date pattern.". But the "f" is used for "Full date/time pattern (short time)." There's a difference between the short date and the short time. So the answer here would be {0:f}.

Hope this helps! :sparkles:

I'm still missing something. Here's the question verbatim:

Complete the following code in order to produce a string that prints the current date.

string.Format("The current date is (blank) .", DateTime.Now.Date)

Jennifer Nordell
Jennifer Nordell
Treehouse Staff

Ah sorry! It's hard to know which question you were referring to. That one is simply {0} because it requires no formatting. The 0 is saying, take the first variable listed after the comma and insert the value here. In this case DateTime.Now.Date. No additional formatting required for this one :sparkles:

You are lovely! Thank you! It was driving me nuts!