In Plone 2.1.2, toPortalTime (that had been marked as deprecated for a while) was replaced with toLocalizedTime, causing products and customizations that use the old name to raise this error.
This should not happen in a minor release, so toPortalTime was re-introduced in Plone 2.1.3. As a quick fix for this problem you can upgrade to Plone 2.1.3, or copy the toPortalTime.py file of 2.1.3 into a custom skin.
We do recommend, however, that you change all calls from toPortalTime to toLocalizedTime. toPortalTime is still deprecated in Plone 2.1, and it was removed in Plone 2.5.
When you encounter this error in Plone 2.5, it's probably caused by a product that hasn't been upgraded for Plone 2.5. Check the product's requirements and supported releases, and notify its maintainer of the problem. You may be able to work around the problem by copying the toPortalTime.py file of Plone 2.1.3 into a custom skin, but you should be prepared to deal with other compatibility problems of the product as well.