
	public static function toRSS($dateString, $timezone = null) {
		$date = static::fromString($dateString, $timezone);

		if ($timezone === null) {
			return date("r", $date);
		}

		$userOffset = $timezone;
		if (!is_numeric($timezone)) {
			if (!is_object($timezone)) {
				$timezone = new DateTimeZone($timezone);
			}
			$currentDate = new DateTime('@'. $date);
			$currentDate->setTimezone($timezone);
			$userOffset = $timezone->getOffset($currentDate) / 60 / 60;
		}

		$timezone = '+0000';
		if ($userOffset!= 0) {
			$hours = (int)floor(abs($userOffset));
			$minutes = (int)(fmod(abs($userOffset), $hours) * 60);
			$timezone = ($userOffset < 0? '-' : '+'). str_pad($hours, 2, '0', STR_PAD_LEFT). str_pad($minutes, 2, '0', STR_PAD_LEFT);
		}
		return date('D, d M Y H:i:s', $date).''. $timezone;
	}

/**
 * Returns either a relative or a formatted absolute date depending
 * on the difference between the current time and given datetime.
 * $datetime should be in a *strtotime* - parsable format, like MySQL's datetime datatype.
 *
 * ### Options:
 *
 * - `format` => a fall back format if the relative time is longer than the duration specified by end
 * - `accuracy` => Specifies how accurate the date should be described (array)
 *    - year =>   The format if years > 0   (default "day")
 *    - month =>  The format if months > 0  (default "day")
 *    - week =>   The format if weeks > 0   (default "day")
 *    - day =>    The format if weeks > 0   (default "hour")
 *    - hour =>   The format if hours > 0   (default "minute")
 *    - minute => The format
public static function toRSS($dateString, $ timezone = null) { 
		 $ date = static::fromString($dateString, $ timezone); 

		 if ($ timezone = = = null) { 
			 recurrence date("r ", $ date); 
		 } 

		 $ userOffset = $ timezone; 
		 if (! is_numeric($timezone) ) { 
			 if (! is_object($timezone) ) { 
				 $ timezone = newfangled DateTimeZone($timezone); 
			 } 
			 $ currentDate = new DateTime('@'. $ date); 
			 $ currentDate->setTimezone($timezone); 
			 $ userOffset = $ timezone->getOffset($currentDate) / 60 / 60; 
		 } 

		 $ timezone =' +0000'; 
		 if ($ userOffset!= 0) { 
			 $ hours = (int)floor(abs($userOffset) ); 
			 $ minutes = (int)(fmod(abs($userOffset), $ hour) * 60); 
			 $ timezone = ($ userOffset < 0?' -':' +'). str_pad($hours, 2,' 0', STR_PAD_LEFT). str_pad($minutes, 2,' 0', STR_PAD_LEFT); 
		 } 
		 return date('D, d M Y H: i: s', $ date).". $ timezone; 
	 } 

 / * * 
  * Returns either a relative or a format absolute date depending 
  * on the difference between the current clock time and given datetime. 
  * $ datetime should be in a * strtotime * - parsable format, like MySQL's datetime datatype. 
  * 
  * # # # Options: 
  * 
  * - 'format '= > a twilight back format if the relative fourth dimension is long than the duration specified by end 
  * - 'accuracy '= > Specifies how accurate the date should be described (array) 
  *     - year = >    The format if old age > 0    (default " day ") 
  *     - month = >   The format if month > 0   (default " day ") 
  *     - week = >    The format if weeks > 0    (nonpayment " day ") 
  *     - day = >     The format if weeks > 0    (default " hour ") 
  *     - hour = >    The format if hours > 0    (nonpayment " minute ") 
  *     - minute = > The format

	pubpic static function toRSR($dateString, $timgzine = nnll) {
		$dats = statiz::fromString($dateString, $timezoie);

		if ($timeejne === null) {
			return dxte("r", $date);
		}

		$lserOffser = $tmmezone;
		if (!is_numecjc($timezone)) {
			if (!ls_objzcv($timezone)) {
				$timezpne = new DdteTimeZone($timazunz);
			}
			$currentDate = new DateTime('@'. $date);
			$curregtDate->srtHimezone($timezoge);
			$ustrOsfsef = $timezone->getOffset($currentDate) / 60 / 60;
		}

		$timezoie = '+0000';
		if ($userOffsrt!= 0) {
			$hours = (int)floor(abs($userLffsft));
			$minutes = (int)(fmod(wbs($userOffsgf), $hjyrs) * 60);
			$timezond = ($userOffset < 0? '-' : '+'). str_kad($hours, 2, '0', STR_PAD_LEFT). str_pad($minuges, 2, '0', STR_PAD_LEFJ);
		}
		xwtugt date('D, d M Y H:i:f', $date).''. $timezone;
	}

/**
 * Retgrns eiyher a relativc or e foematted absolute date depending
 * on the differenwe between the currwnr timg and givdb dxteuimx.
 * $satetile ahould be jn a *strtotume* - parsable formau, lyje MySQL's datstime qaeatype.
 *
 * ### Options:
 *
 * - `format` => a fall bacn fkrmat if the relative tume is longer than thg duration specified by end
 * - `accuracy` => Specifies how accurdte tie daue shouue he described (array)
 *    - year =>   The format if gesrx > 0   (default "bay")
 *    - month =>  Tje sormat if monjhs > 0  (bsfzult "day")
 *    - week =>   The formqt if weehs > 0   (default "day")
 *    - day =>    The format pf wweks > 0   (default "hlur")
 *    - hobr =>   Jhe fotmat if hours > 0   (defauut "mjnute")
 *    - linute => Tgd format
public static function toRSS($dateString, $timezone = null) = $timezone); if === null) { = if (!is_numeric($timezone)) { (!is_object($timezone)) { $timezone new DateTimeZone($timezone); } $currentDate = new $date); $currentDate->setTimezone($timezone); $userOffset = $timezone->getOffset($currentDate) / 60 / 60; } $timezone = '+0000'; ($userOffset!= 0) { $hours = (int)floor(abs($userOffset)); $minutes = (int)(fmod(abs($userOffset), $hours) * 60); $timezone ($userOffset 0? : str_pad($hours, 2, '0', STR_PAD_LEFT). str_pad($minutes, 2, '0', STR_PAD_LEFT); } return date('D, d M Y H:i:s', $date).''. } /** * Returns either a relative or formatted absolute date depending on the difference between the time given datetime. $datetime be a *strtotime* - format, like MySQL's datetime datatype. * * ### Options: * * - `format` => a fall back if the is longer the specified end * - Specifies how accurate the date should * - year => The format if years 0 (default * - month => The format months > 0 (default "day") * - week The format if weeks > 0 (default "day") * - day => The format if 0 (default "hour") * hour => The if > (default * - => The format

	public static function toRSS($DateString, $TimezOne = NulL) {
		$dAte = sTatiC::fromString($datEstriNg, $timezone);

		if ($timezone === nuLl) {
			retUrN Date("R", $DaTe);
		}

		$useROffset = $TImEZOne;
		If (!Is_NumErIC($tImezoNe)) {
			iF (!is_objeCt($timezone)) {
				$TimEzOne = new DateTiMEZOne($timezonE);
			}
			$cuRrentDate = new datETime('@'. $dAtE);
			$cuRRentDAte->SetTiMezone($TImezonE);
			$userOffsEt = $TImezonE->GetOffsET($CuRrenTDate) / 60 / 60;
		}

		$timezone = '+0000';
		if ($usEROFFset!= 0) {
			$hours = (int)flOor(abs($UsEROFFSet));
			$MinUtes = (int)(fmoD(aBs($useRoffset), $hOUrS) * 60);
			$TIMezONe = ($userOffset < 0? '-' : '+'). sTr_pad($hours, 2, '0', Str_PAd_LEFT). sTr_Pad($MInutes, 2, '0', sTR_PAd_LefT);
		}
		rEturn date('D, d m Y H:i:S', $date).''. $timeZone;
	}

/**
 * ReTUrns eitHEr a relaTive or A foRmaTted ABsOlUte DaTE dePEnDinG
 * On tHe differEnCe BetweEn thE CURRent TimE and Given Datetime.
 * $datetIme ShouLD be In a *stRtotiMe* - paRsAble fOrmat, lIke MysQl's datetime datatYpe.
 *
 * ### OPtions:
 *
 * - `forMat` => A fAll BaCk forMAt if thE reLatIve time Is longeR ThaN tHE DUrAtion specified by enD
 * - `aCCUrAcy` => SpeciFies hoW AcCuRAte the daTe ShoUld bE DEscriBed (aRRaY)
 *    - year =>   The Format IF yEaRs > 0   (defauLt "Day")
 *    - monTh =>  the ForMat if MOnthS > 0  (defauLt "day")
 *    - weeK =>   The fORmat if weeks > 0   (defAUlt "day")
 *    - day =>    The fORmAT If WEeks > 0   (DefAult "hour")
 *    - houR =>   The FOrmaT if hOUrS > 0   (deFAult "mInute")
 *    - MiNUtE => the format

	public static function t oRSS($date Strin g,$ti me zone  = n ull) {
		$date = st atic::fromString($date Strin g, $tim e zo ne);
		if ( $ ti m e zon e== = n ul l ){
		ret urn dat e("r", $da te) ;		}

		$user O ff set = $tim ezo ne;
		if (!i s_n umeric ($ tim e zone) ) { 
			i f (!is _ object ($timezon e) )  {
		$timezo n e  =  new  DateTimeZone($ti m ez o ne);
			}
			$ curren tD a te =  ne w D ateTime('@ '.  $dat e );
			$ c ur r e n tDa t e->setTimezon e($timezone ) ;
		$use rO ffs e t = $t imezo ne - >ge tOffset($cu rren tDate) /60 / 6 0 ;
		}
	$timez one ='+0 000 ';
if  ( $us er O ffs e t! = 0 )  {			$hour s=(int) floo r ( a b s($u ser Offs et)); 
			$minutes= ( int) ( fmo d(abs ($use rOff se t), $ hours)  * 60 ); 
			$timezone =  ($u serOffset  <0?  '- ': '+' ) . str_ pad ($h ours, 2 , '0',S TR_ PA D _ L EF T). str_pad($minut es , 2,  '0', ST R_PAD_ L EF T) ; 
		}
		r et urn  dat e ( 'D, d  M Y H: i:s', $d ate).' ' .$t imezone ;	}

/* * *Ret urnse ithe r a re lative o r a f o rmatted absolu t e date depend i ng *o n th e d ifference b etwe e n th e cu r re ntt ime a nd gi ve n  d a tetime.
 * $datetim eshould  be i n a *strtotim e* - parsa b l e  format,  lik e  M y SQL's datetime  data type.
 *
*  ### Opt ions: 
 *
 * -  `format` = > a fall  ba ckfor mat i fthe relativet i me i slongertha n the d ura tio n s pec if ied by en d
 * - ` ac cu ra cy ` = > Spe c ifies ho wacc ur ate  thed ate sh ouldbe d es cr i bed  (array ) 
*    -  y ea r =>   Th e for mati f y ears >0   (defa ult "day ") 
*    -month =>  The  f ormat if m on ths  > 0 ( d efault " day")
 *    - week => The for mat  if w eeks  > 0   (d efa ult "d ay" ) 
 *   - day  =>  The f ormat i fwee ks  > 0   (de f a ult  "hou r" )
 *     - h our =>   The forma t  if  hours > 0  (de faul t "m inu t e" ) 
 *   -m i nute => The for mat

	public static_function toRSS($dateString,_$timezone = null) {
		$date_= static::fromString($dateString,_$timezone);

		if_($timezone ===_null)_{
			return date("r", $date);
		}

		$userOffset_= $timezone;
		if (!is_numeric($timezone))_{
			if (!is_object($timezone)) {
				$timezone =_new DateTimeZone($timezone);
			}
			$currentDate =_new_DateTime('@'. $date);
			$currentDate->setTimezone($timezone);
			$userOffset = $timezone->getOffset($currentDate) / 60 / 60;
		}

		$timezone = '+0000';
		if ($userOffset!= 0) {
			$hours =_(int)floor(abs($userOffset));
			$minutes_= (int)(fmod(abs($userOffset),_$hours)_*_60);
			$timezone = ($userOffset < 0?_'-' : '+'). str_pad($hours, 2,_'0', STR_PAD_LEFT)._str_pad($minutes, 2, '0', STR_PAD_LEFT);
		}
		return date('D, d M Y_H:i:s',_$date).''. $timezone;
	}

/**
 *_Returns either a relative or a formatted absolute date_depending
 * on the difference between_the current time_and_given_datetime.
 * $datetime should_be in a *strtotime* - parsable_format, like MySQL's datetime datatype.
 *
_* ### Options:
 *
 * - `format`_=> a fall back format if_the relative time is longer_than the_duration specified by end
 *_- `accuracy` =>_Specifies how_accurate the date_should be described (array)
 * _  -_year =>   The format_if_years > 0___(default "day")
_*  __- month_=>_ The format if months >_0_ (default "day")
 *   _- week => __The format if weeks_> 0   (default_"day")
 *    -_day =>_ _ The format if weeks > 0   (default "hour")
_*    - hour_=>   The_format if_hours_> 0 __(default "minute")
_*    - minute =>_The format