In Ruby how would I test if the date is ISO 8601 type or not ?
require ‘date’
…
Looking for a method say #date_type, which will tell us what kind of
date object it is.
Date.today.date_type # => ‘ISO 8601’
That doesn’t make any sense. ISO 8601 is about date representations,
which has nothing to do with how a date is stored in a Date object.
Not the date object itself does or does not conform to ISO 8601,
only a string that represents the date can do that.
No idea what you are trying to say with this example.
“%V” and “%U” are different things – they use different ways
of how to count weeks in a year (see the docs) --,
and not surprisingly can therefore give different results.
Regards,
Marcus
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.