Hi,
I've been trying to get the date to display correctly for my date without any success so far. So gist of what I do:
1) Click on 'Add Calendar Event' (calendar event is my content type)
2) Fill in the fields
3) For 'From Date' field, I place a day (use August 15 for test) and for time 8:30pm
4) For 'To Date field, I place a day (use August 16 for test) and for time: 10:30pm
5) Click submit
On the content view, I see for date: August 16 3:30am - August 17 5:30am. From what I understand, that is the UTC time being displayed on the page (I live in Los Angeles and PDT is 7 hours behind GMT/UTC). I am unsure on why that happens because I chose the calendar to use the site's time zone for the conversion and the site's time zone is set to that for Los Angeles. Below are my field settings:
$content[fields] = array (
0 =>
array (
'widget_type' => 'date_popup',
'label' => 'Start/End Time',
'weight' => '1',
'default_value' => 'now',
'default_value_code' => '',
'default_value2' => 'same',
'default_value_code2' => '',
'input_format' => 'd/m/Y h:i:sA',
'input_format_custom' => '',
'year_range' => '-3:+3',
'increment' => '15',
'advanced' =>
array (
'label_position' => 'above',
'text_parts' =>
array (
'year' => 0,
'month' => 0,
'day' => 0,
'hour' => 0,
'minute' => 0,
'second' => 0,
),
),
'description' => '',
'group' => false,
'required' => 1,
'multiple' => '0',
'repeat' => 0,
'todate' => 'required',
'granularity' =>
array (
'year' => 'year',
'month' => 'month',
'day' => 'day',
'hour' => 'hour',
'minute' => 'minute',
),
'output_format_date' => 'M j Y - g:ia',
'output_format_custom' => '',
'output_format_date_long' => 'l, F j, Y - H:i',
'output_format_custom_long' => '',
'output_format_date_medium' => 'D, m/d/Y - H:i',
'output_format_custom_medium' => '',
'output_format_date_short' => 'M j Y - g:ia',
'output_format_custom_short' => '',
'tz_handling' => 'site',
'timezone_db' => 'UTC',
'repeat_collapsed' => '0',
'field_name' => 'field_calendar_event',
'field_type' => 'date',
'module' => 'date',
'label_position' => 'above',
'text_parts' =>
array (
),
),
);
Are there any settings that I may have overlooked in getting the display correct? Any help on this would be greatly appreciated. Please let me know what other info may be needed (I would prefer to create my site without performing any timezone conversion as I also use views and want to try and avoid the offset by seconds if possible).
Comments
Comment #1
btmash commentedI should add what is there in the Devel Load for the field as well:
Comment #2
btmash commentedI'm not quite sure exactly what it is about this that did the trick but I tried a solution from post #10 on #240156: Conflict between Event and Date API by setting the timezone to UTC and then back to site settings and that fixed the issue.