<?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: Covert UNIX Epoch dates in Microsoft Excel &#8211; Including Timezone Examples</title>
	<atom:link href="http://untangible.com/2009/01/covert-unix-epoch-dates-in-microsoft-excel-including-timezone-examples.html/feed" rel="self" type="application/rss+xml" />
	<link>http://untangible.com/2009/01/covert-unix-epoch-dates-in-microsoft-excel-including-timezone-examples.html</link>
	<description></description>
	<lastBuildDate>Wed, 30 Jun 2010 18:24:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Chris</title>
		<link>http://untangible.com/2009/01/covert-unix-epoch-dates-in-microsoft-excel-including-timezone-examples.html/comment-page-1#comment-2031</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Mon, 05 Apr 2010 16:12:43 +0000</pubDate>
		<guid isPermaLink="false">http://untangible.com/blog/?p=206#comment-2031</guid>
		<description>I&#039;ve recently been working in importing datetimes from Excel into an SQL database using PHP.  The library I was using to read the Excel sheet is called phpexcel.  What I found was that there are just too many formats that a date can be stored in (dd/mm/yy, mm/dd/yy, yyyy-mm-dd) for strtotime to be able to handle.  This lead me to import the Excel datetime values and convert to Unix values using the following function:

function time_format($datetime,$tzoffset){

        if(is_numeric($datetime)){

            if(date(&#039;I&#039;)){

            $datetime = (-25569-($tzoffset+1)/24+$datetime)*24*60*60;

            }else{

            $datetime = (-25569-$tzoffset/24+$datetime)*24*60*60;

            }

        }

        $datetime   = date(&#039;Y-m-d H:i:s&#039;,$datetime);

        return $datetime;

    }

The variable $tzoffset is the timezone offset.

The date(&#039;I&#039;) part checks if we are in daylight savings time or not.

I know this isn&#039;t entirely relevant but hopefully it will be of use to someone.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve recently been working in importing datetimes from Excel into an SQL database using PHP.  The library I was using to read the Excel sheet is called phpexcel.  What I found was that there are just too many formats that a date can be stored in (dd/mm/yy, mm/dd/yy, yyyy-mm-dd) for strtotime to be able to handle.  This lead me to import the Excel datetime values and convert to Unix values using the following function:</p>
<p>function time_format($datetime,$tzoffset){</p>
<p>        if(is_numeric($datetime)){</p>
<p>            if(date(&#8216;I&#8217;)){</p>
<p>            $datetime = (-25569-($tzoffset+1)/24+$datetime)*24*60*60;</p>
<p>            }else{</p>
<p>            $datetime = (-25569-$tzoffset/24+$datetime)*24*60*60;</p>
<p>            }</p>
<p>        }</p>
<p>        $datetime   = date(&#8216;Y-m-d H:i:s&#8217;,$datetime);</p>
<p>        return $datetime;</p>
<p>    }</p>
<p>The variable $tzoffset is the timezone offset.</p>
<p>The date(&#8216;I&#8217;) part checks if we are in daylight savings time or not.</p>
<p>I know this isn&#8217;t entirely relevant but hopefully it will be of use to someone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EricPell</title>
		<link>http://untangible.com/2009/01/covert-unix-epoch-dates-in-microsoft-excel-including-timezone-examples.html/comment-page-1#comment-1938</link>
		<dc:creator>EricPell</dc:creator>
		<pubDate>Wed, 17 Mar 2010 15:05:44 +0000</pubDate>
		<guid isPermaLink="false">http://untangible.com/blog/?p=206#comment-1938</guid>
		<description>GMT -03:00 would be:

=((A1-10800)/86400)+25569</description>
		<content:encoded><![CDATA[<p>GMT -03:00 would be:</p>
<p>=((A1-10800)/86400)+25569</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dante</title>
		<link>http://untangible.com/2009/01/covert-unix-epoch-dates-in-microsoft-excel-including-timezone-examples.html/comment-page-1#comment-1937</link>
		<dc:creator>Dante</dc:creator>
		<pubDate>Wed, 17 Mar 2010 14:49:57 +0000</pubDate>
		<guid isPermaLink="false">http://untangible.com/blog/?p=206#comment-1937</guid>
		<description>GMT -03:00.. help?</description>
		<content:encoded><![CDATA[<p>GMT -03:00.. help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Morel</title>
		<link>http://untangible.com/2009/01/covert-unix-epoch-dates-in-microsoft-excel-including-timezone-examples.html/comment-page-1#comment-1669</link>
		<dc:creator>David Morel</dc:creator>
		<pubDate>Mon, 11 Jan 2010 15:12:16 +0000</pubDate>
		<guid isPermaLink="false">http://untangible.com/blog/?p=206#comment-1669</guid>
		<description>Actually, on my version of excel (mac 2008) the dates are off by 3 years. The correct formula seems to be 
=(((A2+3600)/86400)+24107)

this is for GMT+1 of course</description>
		<content:encoded><![CDATA[<p>Actually, on my version of excel (mac 2008) the dates are off by 3 years. The correct formula seems to be<br />
=(((A2+3600)/86400)+24107)</p>
<p>this is for GMT+1 of course</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EricPell</title>
		<link>http://untangible.com/2009/01/covert-unix-epoch-dates-in-microsoft-excel-including-timezone-examples.html/comment-page-1#comment-944</link>
		<dc:creator>EricPell</dc:creator>
		<pubDate>Tue, 11 Aug 2009 14:55:55 +0000</pubDate>
		<guid isPermaLink="false">http://untangible.com/blog/?p=206#comment-944</guid>
		<description>GMT + 8 would be:  &lt;code&gt;=((A1-28800)/86400)-25569&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>GMT + 8 would be:  <code>=((A1-28800)/86400)-25569</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EricPell</title>
		<link>http://untangible.com/2009/01/covert-unix-epoch-dates-in-microsoft-excel-including-timezone-examples.html/comment-page-1#comment-943</link>
		<dc:creator>EricPell</dc:creator>
		<pubDate>Tue, 11 Aug 2009 14:54:56 +0000</pubDate>
		<guid isPermaLink="false">http://untangible.com/blog/?p=206#comment-943</guid>
		<description>Daylight savings time may be tricky.  You&#039;d need some logic in Excel to detect what the date is and then calculate if you need to alter the formula.  I&#039;ll try to look into that some more.</description>
		<content:encoded><![CDATA[<p>Daylight savings time may be tricky.  You&#8217;d need some logic in Excel to detect what the date is and then calculate if you need to alter the formula.  I&#8217;ll try to look into that some more.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luis Blanco</title>
		<link>http://untangible.com/2009/01/covert-unix-epoch-dates-in-microsoft-excel-including-timezone-examples.html/comment-page-1#comment-892</link>
		<dc:creator>Luis Blanco</dc:creator>
		<pubDate>Wed, 05 Aug 2009 16:38:36 +0000</pubDate>
		<guid isPermaLink="false">http://untangible.com/blog/?p=206#comment-892</guid>
		<description>How about The DayLight Time?</description>
		<content:encoded><![CDATA[<p>How about The DayLight Time?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nicker.par</title>
		<link>http://untangible.com/2009/01/covert-unix-epoch-dates-in-microsoft-excel-including-timezone-examples.html/comment-page-1#comment-812</link>
		<dc:creator>nicker.par</dc:creator>
		<pubDate>Mon, 20 Jul 2009 07:24:30 +0000</pubDate>
		<guid isPermaLink="false">http://untangible.com/blog/?p=206#comment-812</guid>
		<description>How about for singapore

GMT +8:00 ??? I M in Dizzy in calculating.

Thanks and rgds</description>
		<content:encoded><![CDATA[<p>How about for singapore</p>
<p>GMT +8:00 ??? I M in Dizzy in calculating.</p>
<p>Thanks and rgds</p>
]]></content:encoded>
	</item>
</channel>
</rss>
