One of my websites has blog-style updates on the home page, but the website is certainly not a blog. It is being indexed by Google and the search engine results page summary shows the date of the latest update. I do not want the date to show in the search engine results page. I've found other posts related to this issue suggesting to render the date using javascript after the page is loaded (tried and google still gets it), or to render the date as an image (would prefer to avoid doing that).
I was wondering if I could simply use PHP to detect if the user agent is a Google bot (or bing, etc.) and in those cases just not output the dates on posts. Is there any drawback to this? Would the search engines be able to detect that I am giving them a modified version of my site and would they penalize me for it?