As we saw in the previous part we can use the DateTime class as type constraint in Moose. So we can declare an attribute to be of type DateTime and Moose will enforce this in the setter.

What if you'd like to create your own type