Date/time calculation?

Is there a way to do some date calculations, like what is the date of the last Sunday in October of the current year?
I’m new to Squirrel and it’s all a bit confusing to me. If someone can point me to some documentation about this, I would be very grateful.