title: How to round unix timestamp up and down to nearest half hour?
body: <p>Ok so I am working on a calendar application within my CRM system and I need to find the upper and lower bounds of the half an hour surrorunding the timestamp at which somebody entered an event in the calendar in order to run some SQL on the DB to determine if they already have something booked in within that timeslot. </p>
  
  <p>For example I have the timestamp of 1330518155 = 29 February 2012 16:22:35 GMT+4
  so I need to get 1330516800 and 1330518600 which equal 16:00 and 16:30. </p>
  
  <p>If anyone has any ideas or think I am approaching developing the calendar in a stupid way let me know! Its my first time on such a task involving so much work with times and dates so any advice appreciated!</p>