Patched timestamp function