Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

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
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

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!