Get Unix timestamp for a date

I needed to compare an event date in Expression Engine to the current date, but the time was not in a unix timestamp. So, I used PHP and converted the time given, to unix timestamp with the PHP functions date() and strtotime().

<?php 
      $time = ( date("g:i a", strtotime("{start_time} UTC"))); 
      $unix = (strtotime('{start_day}-{start_month}-{start_year}'.$time)).'000'; 	  
?>
This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.