<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Easily calculate dates and times in different timezones</title>
	<atom:link href="http://frankkoehl.com/2008/11/easily-calculate-dates-and-times-in-different-timezones/feed/" rel="self" type="application/rss+xml" />
	<link>http://frankkoehl.com/2008/11/easily-calculate-dates-and-times-in-different-timezones/</link>
	<description>The more you know, the more you don't know</description>
	<lastBuildDate>Thu, 11 Mar 2010 01:43:04 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Frank</title>
		<link>http://frankkoehl.com/2008/11/easily-calculate-dates-and-times-in-different-timezones/comment-page-1/#comment-256</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Tue, 06 Jan 2009 16:43:44 +0000</pubDate>
		<guid isPermaLink="false">http://frankkoehl.com/?p=157#comment-256</guid>
		<description>Nice job! The ability to &quot;function-ize&quot; a given code snippet is always a clear sign that someone has grasped the concept(s) at work. This is precisely why I usually don&#039;t provide functions, opting instead for blocks of code that people can read, understand, and then apply.</description>
		<content:encoded><![CDATA[<p>Nice job! The ability to &#8220;function-ize&#8221; a given code snippet is always a clear sign that someone has grasped the concept(s) at work. This is precisely why I usually don&#8217;t provide functions, opting instead for blocks of code that people can read, understand, and then apply.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Godfried</title>
		<link>http://frankkoehl.com/2008/11/easily-calculate-dates-and-times-in-different-timezones/comment-page-1/#comment-229</link>
		<dc:creator>Godfried</dc:creator>
		<pubDate>Mon, 29 Dec 2008 18:14:49 +0000</pubDate>
		<guid isPermaLink="false">http://frankkoehl.com/?p=157#comment-229</guid>
		<description>Hi Frank,

Thanks for your post.
I made a function from your post that outputs a the time in another timezone with a give time in another timezone.:

function time_in_other_tz($source_time,$source_tz,$destination_tz) {

		$currentTimeZone = date_default_timezone_get();
			date_default_timezone_set($source_tz);
			$datetime = new DateTime($source_time);
			$tz = new DateTimeZone($destination_tz);
			$datetime-&gt;setTimezone($tz);
			$toReturn = $datetime-&gt;format(&#039;Y-m-d H:i:s&#039;);
		date_default_timezone_set($currentTimeZone);

	return $toReturn;
}

$source_time = &quot;2008-12-29 19:10:20&quot;;
$source_tz = &#039;Europe/Amsterdam&#039;;
$destination_tz = &#039;Europe/Moscow&#039;;

echo time_in_other_tz($source_time,$source_tz,$destination_tz);</description>
		<content:encoded><![CDATA[<p>Hi Frank,</p>
<p>Thanks for your post.<br />
I made a function from your post that outputs a the time in another timezone with a give time in another timezone.:</p>
<p>function time_in_other_tz($source_time,$source_tz,$destination_tz) {</p>
<p>		$currentTimeZone = date_default_timezone_get();<br />
			date_default_timezone_set($source_tz);<br />
			$datetime = new DateTime($source_time);<br />
			$tz = new DateTimeZone($destination_tz);<br />
			$datetime-&gt;setTimezone($tz);<br />
			$toReturn = $datetime-&gt;format(&#8216;Y-m-d H:i:s&#8217;);<br />
		date_default_timezone_set($currentTimeZone);</p>
<p>	return $toReturn;<br />
}</p>
<p>$source_time = &#8220;2008-12-29 19:10:20&#8243;;<br />
$source_tz = &#8216;Europe/Amsterdam&#8217;;<br />
$destination_tz = &#8216;Europe/Moscow&#8217;;</p>
<p>echo time_in_other_tz($source_time,$source_tz,$destination_tz);</p>
]]></content:encoded>
	</item>
</channel>
</rss>
