0028 Date_parse

The default current century 🤯

A 2-digit year will default to « current century ». This one starts in 1969! To avoid surprises, it’s best to use strptime, which also validates the format.

0028-date_parse_1.png

However, parse allows you to avoid specifying « the current century ».

0028-date_parse_2.png

Bonus: the _parse and _strptime methods returning a hash can be very useful.

0028-date_parse_3.png

Links to Ruby documentation for parse and strptime.