Is there a way to determine the temporal type of a passed object? Currently I have a Temporal parameter that turns a Temporal into a LocalDate and returns the LocalDate object.
Assuming I pass a LocalDateTime in this Temporal parameter, the method will raise an exception.
Is there a way to find out the type of the passed temporal?
I don’t know how you made your conversion to
LocalDate. I believe that this one works.It has no problem accepting a
LocalDateTime:When I ran this code just now, I got this output:
It doesn’t work for just any
Temporalat all, of course.