Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. $start = $data->field_field_ce_date[0]['raw']['value'];
  4. $end = $data->field_field_ce_date[0]['raw']['value2'];
  5.  
  6. $start_month = gmdate("F", $start);
  7. $end_month = gmdate("F", $end);
  8.  
  9. $start_day = gmdate("J", $start);
  10. $end_day = gmdate("J", $end);
  11.  
  12. if ($start_month == $end_month && $start_day == $end_day) {
  13. echo gmdate("F jS", $start);
  14. } elseif ($start_month == $end_month && $start_day != $end_day) {
  15. echo gmdate("F jS", $start);
  16. echo " to ";
  17. echo gmdate("jS", $end);
  18. } elseif ($start_month != $end_month) {
  19. echo gmdate("F jS", $start);
  20. echo " to ";
  21. echo gmdate("F jS", $end);
  22. }
  23.  
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement