Date format seems to be buggy


#1

ISO8601 states that dates should be expressed as yyyy-mm-dd or yyyymmdd but none of the exercises accept that. They all seem to want some weird mm/dd/yyyy format.

Exercise 4 is the strangest. It starts off with the correct yyyy-mm-dd and then it wants you to change it to the faulty mm/dd/yyyy.

This feels like something that needs to be fixed.


#2

ISO 8601 gives us an international standard for date and time formatting for code processing. We use it for things like SQL timestamps as one example.

However, it’s not how humans are used to reading dates. In the US, we like month then day then year. In Europe, they like day then month then year.

When we want to display dates on a web page, we want to format them in such a way that our viewers understand the date. Right?

The exercise is walking you through the process of formatting strings. In this case, it’s formatting dates and times. It’s showing you that you have the power to organize the datetime elements and create expressive, readable content for your audience.

Does that make sense?


#3

Yeah it does makes sense now, thank you. After reading your post I had a cup of coffee and a second look at the problems and I understand now that the dates themselves are just secondary and the main point was to learn string formatting.

I was just confused because 8601 is what I grew up with and it’s what we used all through primary school. I guess I shouldn’t be so quick to make assumptions about everyone else based on personal experiences.


#4

Perfect. Good job. We have to look at the context of what it is we are being asked to do or the problem to be solved. That’s a huge part of our jobs as developers, programmers, and engineers.

8601 is one standard and has a specific use case. But it’s not what we want to use when rendering out to the browser for viewers of that web page. Non-technical people will be confused by that formatting.

Many times, we even go further to produce content that fits the audience, such as giving a post time in freshness of x minutes ago or 1 day ago. We may even use the full calendar with the name of the month.

The exercises here will help you to see what’s possible and open your mind to different ways of solving problems.

Cheers :slight_smile:


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.