I used following and it worked:
DECLARE
@RenameTableDetail varchar(50)
SELECT
@RenameTableDetail = Replace(('TableDetail' + CAST ( GetDate() AS varchar (50 ))), ' ', '_')
print
@RenameTableDetail
EXEC
sp_rename @objname = 'TableDetail', @newname = @RenameTableDetail
GO