Very true, but in you have already included a MySQL specific function (UNIX_TIMESTAMP) in your above example thus excluding you from any platform independence. Having one function in your script that requires MySQL forces all the rest of your script to require it as well by default (unless you do some sort of modularized set up, but a simple script won't cope.) Therefore your argument of having the subroutine to do the conversion to be cross platform is moot because you are already requiring MySQL.