Empty a file but preserve timestamp

What if you want to empty a file without deleting it and yet preserve the timestamp? Below is how you can do it using the touch command.

#make a copy of the file being modified
server:/var/log$ touch -r debug.log debug.tmp
#empty the file
server:/var/log$ > debug.log
#restore the original timestamp
server:/var/log$ touch -r debug.tmp debug.log
#remove the old file
server:/var/log$ rm debug.tmp