Skip to content

Instantly share code, notes, and snippets.

@chadsten
Last active December 22, 2015 08:09
Show Gist options
  • Select an option

  • Save chadsten/6443089 to your computer and use it in GitHub Desktop.

Select an option

Save chadsten/6443089 to your computer and use it in GitHub Desktop.
<?
// 2013-09-30 18:00:00 to 2013-09-30 20:00:00 (contents of #markup)
$dates = explode(' to ', $items[0]['#markup']);
$time_format = 'g:i A';
$date_format = 'F jS, Y';
$s = $dates[0] . " -0500";
$start = strtotime($s);
//$start_date = date($date_format, $start);
//$start_time = date($time_format, $start);
$start_date = format_date($start, 'custom', $date_format, 'America/Chicago');
$start_time = format_date($start, 'custom', $time_format, 'America/Chicago');
dpm($s);
dpm($start);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment