I'm having trouble rewriting the output of datefield in Drupal 7 Views - php is not my strong point. 

Just for reference I'm using the latest stable versions of Date, Views, and D7, and the theme framework I'm using is Omega 3. 

On my content type I want to change the way the date is displayed. I've created a custom date type, but I don't have the ability to style it the way I'd like due to it all being wrapped in the same container.

I've drilled down in to my theme information and pulled out the template that handles the date field for my view and I'm trying to rewrite it so that it's wrapped in its own divs and I can then apply classes and style it. Here is what I have

EDIT: This is what I'm currently using.

```
<?php

/**
 * @file
 * This template is used to print a single field in a view.
 *
 * It is not actually used in default Views, as this is registered as a theme
 * function which has better performance. For single overrides, the template is
 * perfectly okay.
 *
 * Variables available:
 * - $view: The view object
 * - $field: The field handler object that can process the input
 * - $row: The raw SQL result that can be used
 * - $output: The processed output that will normally be used.
 *
 * When fetching output from the $row, this construct should be used:
 * $data = $row->{$field->field_alias}
 *
 * The above will guarantee that you'll always get the correct data,
 * regardless of any changes in the aliasing that might happen if
 * the view is modified.
 */
?>

<?php
$timestamp = strtotime(
    $row->{$field->['field_event_date']->raw});
$ev_month = format_date($timestamp, 'custom', 'F');
$ev_day = format_date($timestamp, 'custom', 'd');
?>

<div class="upcoming-date">
<span class="month"><?php print "$ev_month"; ?></span>
<span class="day"><?php print "$ev_day"; ?></span>
</div>

```

Unfortunately is producing a ton of errors and I'm not sure how to resolve them. Here is a sample.

```
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_timezone_set() expects parameter 1 to be datetime, boolean given in format_date() (line 2014 of /var/www/vhosts/.../drupal/includes/common.inc).
warning: date_format() expects parameter 1 to be datetime, boolean given in format_date() (line 2024 of /var/www/vhosts/.../drupal/includes/common.inc).

```

It's my understanding that due to the nature of the way the datefield handles the date it needs to be converted to a unix timestamp so that's the first part, then the second part is trying to take that output and rewrite it so that it's in a custom format so I can isolate the individual parts for styling.

can any of the PHP gurus help me out here?