date

Fix for Fix for Fix for Convert timezone from second in Drupal to WC3 standard.

  1. // Convert timezone from second in Drupal to WC3 standard.
  2. // Starts like: "-28800" and becomes: "-08:00"
  3. $sec = substr($val, 1);
  4. $hours = intval(intval($sec) / 3600);
  5. $minutes = intval(($sec / 60

Fix for Fix for Convert timezone from second in Drupal to WC3 standard.

  1. // Convert timezone from second in Drupal to WCstandard.
  2. // Starts like: "-28800" and becomes: "-08:00"
  3. $sec = substr($val, 1);
  4. $hours = intval(intval($sec) / 3600);
  5. $minutes = intval(($sec / 60)
doublejosh's picture

Fix for Convert timezone from second in Drupal to WC3 standard.

  1. // Convert timezone from second in Drupal to WC3 standard.
  2. // Starts like: "-28800" and becomes: "-08:00"
  3. $sec = substr($val, 1);
  4. $hours = intval(intval($sec) / 3600);
  5. $minutes = intval(($sec / 60
doublejosh's picture

Even better, this function goes back and forth

  1. // Convert timezone from second in Drupal to WC3 standard, and back.
  2. function timezoneConvert($val, $toSeconds = false) {
  3.     if(!$toSeconds) {
  4.         // Starts like: "-28800" and becomes: "-08:00"
  5.         $se

Convert timezone from second in Drupal to WC3 standard.

  1. // Convert timezone from second in Drupal to WC3 standard.
  2. // Starts like: "-28800" and becomes: "-08:00"
  3. $sec = substr($val, 1);
  4. $hours = intval(intval($sec) / 3600);
  5. $minutes = intval(($sec / 60

Fix for Fix for Fix for Incorrect Date due to timezone.

  1. // The following code produces correct results.
  2.    //$datestamp = strtotime($event_ref->field_event_date[0]['value']);
  3.    //$date = format_date($datestamp, 'custom','D d F Y');
  4.    $date = date("D d

Fix for Fix for Incorrect Date due to timezone.

  1. // The following code produces correct results.
  2.    //$datestamp = strtotime($event_ref->field_event_date[0]['value']);
  3.    //$date = format_date($datestamp, 'custom','D d F Y');
  4.    $date = date("D d

Fix for attempting to create a date_popup form element

  1. $form['start_date'] = array(
  2.         '#type' => 'date_popup',
  3.         '#title' => t('Start Date'),
  4.         '#date_timezone' => date_default_timezone_name(),
  5.         '#date_format' => 'F j, Y',
  6.         '#date_increment' => 1,
  7.         '#d

Fix for attempting to create a date_popup form element

  1. $form['start_date'] = array(
  2.         '#type' => 'date_popup',
  3.         '#title' => t('Start Date'),
  4.         '#date_timezone' => date_default_timezone_name(),
  5.         '#date_format' => 'F j, Y',
  6.         '#date_increment' => 1,
  7.         '#d

Fix for Incorrect Date due to timezone.

  1. // The following code produces correct results.
  2.    //$datestamp = strtotime($event_ref->field_event_date[0]['value']);
  3.    //$date = format_date($datestamp, 'custom','D d F Y');
  4.    $date = date("D d
Syndicate content