<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Blog &#187; date</title>
	<atom:link href="http://blog.thuongtin.net/tag/date/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thuongtin.net</link>
	<description>php, sql, autoit, javascript, c, html</description>
	<lastBuildDate>Tue, 15 Sep 2009 00:57:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Chuyển đổi các múi giờ</title>
		<link>http://blog.thuongtin.net/2008/11/18/chuyen-doi-cac-mui-gio/</link>
		<comments>http://blog.thuongtin.net/2008/11/18/chuyen-doi-cac-mui-gio/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 04:06:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=343</guid>
		<description><![CDATA[Converting Between Different Time Zones
&#60;?php
// function to get time
// for another time zone
// given a specific timestamp and hour offset from GMT

function getLocalTime($ts, $offset) {
// performs conversion
// returns UNIX timestamp
return ($ts - date(&#34;Z&#34;, $ts)) + (3600 * $offset);
}
// get current local time in Singapore
// result: &#34;00:11:26 31-10-06 SST&#34;
echo date(&#34;H:i:s d-m-y&#34;, getLocalTime(mktime(), 8)) . &#34; SST ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first"><span style="font-style: italic;">Converting Between Different Time Zones</span></p>
<pre class="brush: php;">&lt;?php
// function to get time
// for another time zone
// given a specific timestamp and hour offset from GMT

function getLocalTime($ts, $offset) {
// performs conversion
// returns UNIX timestamp
return ($ts - date(&quot;Z&quot;, $ts)) + (3600 * $offset);
}
// get current local time in Singapore
// result: &quot;00:11:26 31-10-06 SST&quot;
echo date(&quot;H:i:s d-m-y&quot;, getLocalTime(mktime(), 8)) . &quot; SST \n&quot;;
// get current local time in India
// result: &quot;21:41:26 30-10-06 IST&quot;
echo date(&quot;H:i:s d-m-y&quot;, getLocalTime(mktime(), +5.5)) . &quot; IST \n&quot;;
// get current local time in USA (Eastern)
// result: &quot;11:11:26 30-10-06 EST&quot;
echo date(&quot;H:i:s d-m-y&quot;, getLocalTime(mktime(), -5)) . &quot; EST \n&quot;;
// get current local time in USA (Pacific)
// result: &quot;08:11:26 30-10-06 PST&quot;
echo date(&quot;H:i:s d-m-y&quot;, getLocalTime(mktime(), -8)) . &quot; PST \n&quot;;
// get time in GMT
// when it is 04:30 AM in India
// result: &quot;23:00:00 01-02-05 GMT &quot;
echo date(&quot;H:i:s d-m-y&quot;, getLocalTime(mktime(4,30,0,2,2,2005), 0)) .?
&quot; GMT \n&quot;;
?&gt;
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/11/18/so-sanh-2-ngay/" rel="bookmark">So sánh 2 ngày</a></li><li><a href="http://blog.thuongtin.net/2008/10/29/so-sanh-2-ngay-comparing-dates/" rel="bookmark">So sánh 2 ngày - Comparing Dates</a></li><li><a href="http://blog.thuongtin.net/2008/09/12/tao-1-file-download-file/" rel="bookmark">Tạo 1 file download file</a></li><li><a href="http://blog.thuongtin.net/2008/09/12/class-login/" rel="bookmark">Class login</a></li><li><a href="http://blog.thuongtin.net/2008/10/29/chuyen-doi-phut-sang-gio-va-nguoc-lai/" rel="bookmark">Chuyển đổi phút sang giờ và ngược lại</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=343&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/11/18/chuyen-doi-cac-mui-gio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chuyển đổi phút sang giờ và ngược lại</title>
		<link>http://blog.thuongtin.net/2008/11/18/chuyen-doi-phut-sang-gio-va-nguoc-lai-2/</link>
		<comments>http://blog.thuongtin.net/2008/11/18/chuyen-doi-phut-sang-gio-va-nguoc-lai-2/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 04:00:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=340</guid>
		<description><![CDATA[Converting Minutes to Hours
Phút qua giờ:

&#60;?php
// define number of minutes
$mm = 156;
// convert to hh:mm format
// result: &#34;02h 36m&#34;
echo sprintf(&#34;%02dh %02dm&#34;, floor($mm/60), $mm%60);
?&#62;

Ngược lại:

&#60;?php
// define hours and minutes
$hhmm = &#34;02:36&#34;;
// convert to minutes
// result: &#34;156 minutes&#34;
$arr = explode(&#34;:&#34;, $hhmm);
echo $arr[0]*60 + $arr[1] . &#34; minutes&#34;;
?&#62;

Related Posts:Chuyển đổi phút sang giờ và ngược lạiPHP Function to ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first"><span style="font-style: italic;">Converting Minutes to Hours</span></p>
<p><strong>Phút qua giờ</strong>:</p>
<pre class="brush: php;">
&lt;?php
// define number of minutes
$mm = 156;
// convert to hh:mm format
// result: &quot;02h 36m&quot;
echo sprintf(&quot;%02dh %02dm&quot;, floor($mm/60), $mm%60);
?&gt;
</pre>
<p><strong>Ngược lại:</strong></p>
<pre class="brush: php;">
&lt;?php
// define hours and minutes
$hhmm = &quot;02:36&quot;;
// convert to minutes
// result: &quot;156 minutes&quot;
$arr = explode(&quot;:&quot;, $hhmm);
echo $arr[0]*60 + $arr[1] . &quot; minutes&quot;;
?&gt;
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/10/29/chuyen-doi-phut-sang-gio-va-nguoc-lai/" rel="bookmark">Chuyển đổi phút sang giờ và ngược lại</a></li><li><a href="http://blog.thuongtin.net/2008/11/04/php-function-to-calculate-time-remaining/" rel="bookmark">PHP Function to calculate time remaining</a></li><li><a href="http://blog.thuongtin.net/2008/11/18/chuyen-doi-cac-mui-gio/" rel="bookmark">Chuyển đổi các múi giờ</a></li><li><a href="http://blog.thuongtin.net/2008/10/18/8-mau-regular-expressions-huu-ich/" rel="bookmark">8 mẫu Regular Expressions hữu ích</a></li><li><a href="http://blog.thuongtin.net/2008/09/11/mot-so-cach-xu-ly-chuoi/" rel="bookmark">Một số cách xử lý chuỗi</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=340&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/11/18/chuyen-doi-phut-sang-gio-va-nguoc-lai-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>So sánh 2 ngày</title>
		<link>http://blog.thuongtin.net/2008/11/18/so-sanh-2-ngay/</link>
		<comments>http://blog.thuongtin.net/2008/11/18/so-sanh-2-ngay/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 03:58:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=338</guid>
		<description><![CDATA[Comparing Dates

&#60;?php
// create timestamps for two dates
$date1 = mktime(0,0,0,2,1,2007);
$date2 = mktime(1,0,0,2,1,2007);
// compare timestamps
// to see which represents an earlier date
if ($date1 &#62; $date2) {
$str = date (&#34;d-M-Y H:i:s&#34;, $date2) . &#34; comes before &#34; .?
date (&#34;d-M-Y H:i:s&#34;, $date1);
} else if ($date2 &#62; $date1) {
$str = date (&#34;d-M-Y H:i:s&#34;, $date1) . &#34; comes before &#34; .?
date ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first"><span style="font-style: italic;">Comparing Dates</span></p>
<pre class="brush: php;">
&lt;?php
// create timestamps for two dates
$date1 = mktime(0,0,0,2,1,2007);
$date2 = mktime(1,0,0,2,1,2007);
// compare timestamps
// to see which represents an earlier date
if ($date1 &gt; $date2) {
$str = date (&quot;d-M-Y H:i:s&quot;, $date2) . &quot; comes before &quot; .?
date (&quot;d-M-Y H:i:s&quot;, $date1);
} else if ($date2 &gt; $date1) {
$str = date (&quot;d-M-Y H:i:s&quot;, $date1) . &quot; comes before &quot; .?
date (&quot;d-M-Y H:i:s&quot;, $date2);
} else {
$str = &quot;Dates are equal&quot;;
}
// result: &quot;01-Feb-2007 00:00:00 comes before 01-Feb-2007 01:00:00&quot;
echo $str;
?&gt;
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/10/29/so-sanh-2-ngay-comparing-dates/" rel="bookmark">So sánh 2 ngày - Comparing Dates</a></li><li><a href="http://blog.thuongtin.net/2008/11/18/chuyen-doi-cac-mui-gio/" rel="bookmark">Chuyển đổi các múi giờ</a></li><li><a href="http://blog.thuongtin.net/2008/10/18/8-mau-regular-expressions-huu-ich/" rel="bookmark">8 mẫu Regular Expressions hữu ích</a></li><li><a href="http://blog.thuongtin.net/2008/09/09/gui-email-dang-html-voi-ham-mail/" rel="bookmark">Gửi email dạng HTML với hàm mail()</a></li><li><a href="http://blog.thuongtin.net/2008/09/10/class-curl/" rel="bookmark">Class Curl</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=338&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/11/18/so-sanh-2-ngay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Function to calculate time remaining</title>
		<link>http://blog.thuongtin.net/2008/11/04/php-function-to-calculate-time-remaining/</link>
		<comments>http://blog.thuongtin.net/2008/11/04/php-function-to-calculate-time-remaining/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 04:03:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=306</guid>
		<description><![CDATA[PHP Function to calculate time remaining.
//FUNCTION FOR TIME LEFT
function time_left($integer)
{

$seconds=$integer;

if ($seconds/60 &#62;=1)

{

$minutes=floor($seconds/60);

if ($minutes/60 &#62;= 1)

{ # Hours

$hours=floor($minutes/60);

if ($hours/24 &#62;= 1)

{ #days

$days=floor($hours/24);

if ($days/7 &#62;=1)

{ #weeks

$weeks=floor($days/7);

if ($weeks&#62;=2) $return=&#34;$weeks Weeks&#34;;

else $return=&#34;$weeks Week&#34;;

} #end of weeks

$days=$days-(floor($days/7))*7;

if ($weeks&#62;=1 &#38;&#38; $days &#62;=1) $return=&#34;$return, &#34;;

if ($days &#62;=2) $return=&#34;$return $days days&#34;;

if ($days ==1) $return=&#34;$return $days day&#34;;

} #end of days

$hours=$hours-(floor($hours/24))*24;

if ($days&#62;=1 &#38;&#38; $hours &#62;=1) ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">PHP Function to calculate time remaining.</p>
<pre class="brush: php;">//FUNCTION FOR TIME LEFT
function time_left($integer)
{

$seconds=$integer;

if ($seconds/60 &gt;=1)

{

$minutes=floor($seconds/60);

if ($minutes/60 &gt;= 1)

{ # Hours

$hours=floor($minutes/60);

if ($hours/24 &gt;= 1)

{ #days

$days=floor($hours/24);

if ($days/7 &gt;=1)

{ #weeks

$weeks=floor($days/7);

if ($weeks&gt;=2) $return=&quot;$weeks Weeks&quot;;

else $return=&quot;$weeks Week&quot;;

} #end of weeks

$days=$days-(floor($days/7))*7;

if ($weeks&gt;=1 &amp;&amp; $days &gt;=1) $return=&quot;$return, &quot;;

if ($days &gt;=2) $return=&quot;$return $days days&quot;;

if ($days ==1) $return=&quot;$return $days day&quot;;

} #end of days

$hours=$hours-(floor($hours/24))*24;

if ($days&gt;=1 &amp;&amp; $hours &gt;=1) $return=&quot;$return, &quot;;

if ($hours &gt;=2) $return=&quot;$return $hours hours&quot;;

if ($hours ==1) $return=&quot;$return $hours hour&quot;;

} #end of Hours

$minutes=$minutes-(floor($minutes/60))*60;

if ($hours&gt;=1 &amp;&amp; $minutes &gt;=1) $return=&quot;$return, &quot;;

if ($minutes &gt;=2) $return=&quot;$return $minutes minutes&quot;;

if ($minutes ==1) $return=&quot;$return $minutes minute&quot;;

} #end of minutes

$seconds=$integer-(floor($integer/60))*60;

if ($minutes&gt;=1 &amp;&amp; $seconds &gt;=1) $return=&quot;$return, &quot;;

if ($seconds &gt;=2) $return=&quot;$return $seconds seconds&quot;;

if ($seconds ==1) $return=&quot;$return $seconds second&quot;;

$return=&quot;$return.&quot;;

return $return;

}

/* Returns a string of the amount of time the integer (in seconds) refers
to.

$timeleft=time_left(86400);

$timeleft='1 day'.

Will not return anything higher than weeks. False if $integer=0 or fails.

*/
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/10/29/chuyen-doi-phut-sang-gio-va-nguoc-lai/" rel="bookmark">Chuyển đổi phút sang giờ và ngược lại</a></li><li><a href="http://blog.thuongtin.net/2008/11/18/chuyen-doi-phut-sang-gio-va-nguoc-lai-2/" rel="bookmark">Chuyển đổi phút sang giờ và ngược lại</a></li><li><a href="http://blog.thuongtin.net/2008/09/12/lay-thoi-gian-cua-tap-tin-flv/" rel="bookmark">Lấy thời gian của tập tin .flv</a></li><li><a href="http://blog.thuongtin.net/2008/11/04/chuyen-so-thanh-so-la-ma/" rel="bookmark">Chuyển số thành số La Mã</a></li><li><a href="http://blog.thuongtin.net/2008/09/12/file-sao-luu-du-lieu/" rel="bookmark">File sao lưu dữ liệu</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=306&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/11/04/php-function-to-calculate-time-remaining/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>So sánh 2 ngày &#8211; Comparing Dates</title>
		<link>http://blog.thuongtin.net/2008/10/29/so-sanh-2-ngay-comparing-dates/</link>
		<comments>http://blog.thuongtin.net/2008/10/29/so-sanh-2-ngay-comparing-dates/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 08:48:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[function]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=255</guid>
		<description><![CDATA[

&#60;?php
// create timestamps for two dates
$date1 = mktime(0,0,0,2,1,2007);
$date2 = mktime(1,0,0,2,1,2007);
// compare timestamps
// to see which represents an earlier date
if ($date1 &#62; $date2) {
$str = date (&#34;d-M-Y H:i:s&#34;, $date2) . &#34; comes before &#34; .?
date (&#34;d-M-Y H:i:s&#34;, $date1);
} else if ($date2 &#62; $date1) {
$str = date (&#34;d-M-Y H:i:s&#34;, $date1) . &#34; comes before &#34; .?
date (&#34;d-M-Y ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">
<pre class="brush: php;">
&lt;?php
// create timestamps for two dates
$date1 = mktime(0,0,0,2,1,2007);
$date2 = mktime(1,0,0,2,1,2007);
// compare timestamps
// to see which represents an earlier date
if ($date1 &gt; $date2) {
$str = date (&quot;d-M-Y H:i:s&quot;, $date2) . &quot; comes before &quot; .?
date (&quot;d-M-Y H:i:s&quot;, $date1);
} else if ($date2 &gt; $date1) {
$str = date (&quot;d-M-Y H:i:s&quot;, $date1) . &quot; comes before &quot; .?
date (&quot;d-M-Y H:i:s&quot;, $date2);
} else {
$str = &quot;Dates are equal&quot;;
}
// result: &quot;01-Feb-2007 00:00:00 comes before 01-Feb-2007 01:00:00&quot;
echo $str;
?&gt;
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/11/18/so-sanh-2-ngay/" rel="bookmark">So sánh 2 ngày</a></li><li><a href="http://blog.thuongtin.net/2008/11/18/chuyen-doi-cac-mui-gio/" rel="bookmark">Chuyển đổi các múi giờ</a></li><li><a href="http://blog.thuongtin.net/2008/09/09/gui-email-dang-html-voi-ham-mail/" rel="bookmark">Gửi email dạng HTML với hàm mail()</a></li><li><a href="http://blog.thuongtin.net/2008/10/07/12-javascript-image-galleries/" rel="bookmark">12 Javascript Image Galleries</a></li><li><a href="http://blog.thuongtin.net/2008/09/12/tao-1-file-download-file/" rel="bookmark">Tạo 1 file download file</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=255&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/10/29/so-sanh-2-ngay-comparing-dates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery UI Datepicker</title>
		<link>http://blog.thuongtin.net/2008/10/21/jquery-ui-datepicker/</link>
		<comments>http://blog.thuongtin.net/2008/10/21/jquery-ui-datepicker/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 02:19:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=210</guid>
		<description><![CDATA[Dùng để áp dụng trong việc cho thành viên đăng ký ngày sinh.
http://marcgrabanski.com/pages/code/jquery-ui-datepicker
Related Posts:jQuery: Thêm một Class (lớp với CSS)14 lời khuyên của ông I.E.C. Haramis10 lời khuyên để thành nhà đầu tư thành côngjQuery: Cơ bản[ JS Object ] Math]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">Dùng để áp dụng trong việc cho thành viên đăng ký ngày sinh.</p>
<p><span style="font-weight: bold;">http://marcgrabanski.com/pages/code/jquery-ui-datepicker</span></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/10/10/them-mot-class-lop-voi-css/" rel="bookmark">jQuery: Thêm một Class (lớp với CSS)</a></li><li><a href="http://blog.thuongtin.net/2009/04/21/14-loi-khuyen-cua-ong-iec-haramis/" rel="bookmark">14 lời khuyên của ông I.E.C. Haramis</a></li><li><a href="http://blog.thuongtin.net/2009/04/21/10-loi-khuyen-de-thanh-nha-dau-tu-thanh-cong/" rel="bookmark">10 lời khuyên để thành nhà đầu tư thành công</a></li><li><a href="http://blog.thuongtin.net/2008/10/10/jquery-co-ban/" rel="bookmark">jQuery: Cơ bản</a></li><li><a href="http://blog.thuongtin.net/2009/07/03/js-object-math/" rel="bookmark">[ JS Object ] Math</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=210&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/10/21/jquery-ui-datepicker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
