title: Warning: date() expects parameter 2 to be long,
body: <p>Getting the followoing error:</p>
  
  <blockquote>
    <p>Warning: date() expects parameter 2 to be long, string given in
    /home/users/2/catfood.jp-cybercat/web/academy/wp-includes/functions.php
    on line 112</p>
  </blockquote>
  
  <p>Which points to the line:</p>
  
  <pre><code>$datemonth = $wp_locale-&gt;get_month( $datefunc( 'm', $i ) );
  </code></pre>
  
  <p>What changes are required to the above line to resolve this?</p>
  
  <p>Here is the whole codes</p>
  
  <pre><code>function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) {
  global $wp_locale;
  $i = $unixtimestamp;
  
  if ( false === $i ) {
      if ( ! $gmt )
          $i = current_time( 'timestamp' );
      else
          $i = time();
      // we should not let date() interfere with our
      // specially computed timestamp
      $gmt = true;
  }
  
  /*
   * Store original value for language with untypical grammars.
   * See https://core.trac.wordpress.org/ticket/9396
   */
  $req_format = $dateformatstring;
  
  $datefunc = $gmt? 'gmdate' : 'date';
  
  if ( ( !empty( $wp_locale-&gt;month ) ) &amp;&amp; ( !empty( $wp_locale-&gt;weekday ) ) ) {
      $datemonth = $wp_locale-&gt;get_month( $datefunc( 'm', $i ) );
      $datemonth_abbrev = $wp_locale-&gt;get_month_abbrev( $datemonth );
      $dateweekday = $wp_locale-&gt;get_weekday( $datefunc( 'w', $i ) );
      $dateweekday_abbrev = $wp_locale-&gt;get_weekday_abbrev( $dateweekday );
      $datemeridiem = $wp_locale-&gt;get_meridiem( $datefunc( 'a', $i ) );
      $datemeridiem_capital = $wp_locale-&gt;get_meridiem( $datefunc( 'A', $i ) );
      $dateformatstring = ' '.$dateformatstring;
      $dateformatstring = preg_replace( "/([^\\\])D/", "\\1" . backslashit( $dateweekday_abbrev ), $dateformatstring );
      $dateformatstring = preg_replace( "/([^\\\])F/", "\\1" . backslashit( $datemonth ), $dateformatstring );
      $dateformatstring = preg_replace( "/([^\\\])l/", "\\1" . backslashit( $dateweekday ), $dateformatstring );
      $dateformatstring = preg_replace( "/([^\\\])M/", "\\1" . backslashit( $datemonth_abbrev ), $dateformatstring );
      $dateformatstring = preg_replace( "/([^\\\])a/", "\\1" . backslashit( $datemeridiem ), $dateformatstring );
      $dateformatstring = preg_replace( "/([^\\\])A/", "\\1" . backslashit( $datemeridiem_capital ), $dateformatstring );
  
      $dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
  }
  $timezone_formats = array( 'P', 'I', 'O', 'T', 'Z', 'e' );
  $timezone_formats_re = implode( '|', $timezone_formats );
  if ( preg_match( "/$timezone_formats_re/", $dateformatstring ) ) {
      $timezone_string = get_option( 'timezone_string' );
      if ( $timezone_string ) {
          $timezone_object = timezone_open( $timezone_string );
          $date_object = date_create( null, $timezone_object );
          foreach( $timezone_formats as $timezone_format ) {
              if ( false !== strpos( $dateformatstring, $timezone_format ) ) {
                  $formatted = date_format( $date_object, $timezone_format );
                  $dateformatstring = ' '.$dateformatstring;
                  $dateformatstring = preg_replace( "/([^\\\])$timezone_format/", "\\1" . backslashit( $formatted ), $dateformatstring );
                  $dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
              }
          }
      }
  }
  $j = @$datefunc( $dateformatstring, $i );
  
  /**
   * Filter the date formatted based on the locale.
   *
   * @since 2.8.0
   *
   * @param string $j          Formatted date string.
   * @param string $req_format Format to display the date.
   * @param int    $i          Unix timestamp.
   * @param bool   $gmt        Whether to convert to GMT for time. Default false.
   */
  $j = apply_filters( 'date_i18n', $j, $req_format, $i, $gmt );
  return $j;
  }
  </code></pre>