<?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>gHacks technology news &#187; time</title>
	<atom:link href="http://www.ghacks.net/tag/time/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Tue, 24 Nov 2009 23:31:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Look Up Local Time, Date And Weather Of Any Place In The World</title>
		<link>http://www.ghacks.net/2009/09/09/look-up-local-time-date-and-weather-of-any-place-in-the-world/</link>
		<comments>http://www.ghacks.net/2009/09/09/look-up-local-time-date-and-weather-of-any-place-in-the-world/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 07:02:16 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Online Services]]></category>
		<category><![CDATA[The Web]]></category>
		<category><![CDATA[local date]]></category>
		<category><![CDATA[local time]]></category>
		<category><![CDATA[local weather]]></category>
		<category><![CDATA[look up local time]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[timezone]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=16151</guid>
		<description><![CDATA[Looking up information like the local time, local date or local weather can be helpful in certain circumstances. Maybe you are planning a trip to another location and want to make sure to be prepared, maybe you do not want to miss the important video conference with that other company from China (or another country) [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.ghacks.net/wp-content/uploads/2009/09/local_time.jpg" alt="local time" title="local time" width="415" height="103" class="alignleft size-full wp-image-16152" />Looking up information like the local time, local date or local weather can be helpful in certain circumstances. Maybe you are planning a trip to another location and want to make sure to be prepared, maybe you do not want to miss the important video conference with that other company from China (or another country) or maybe you just want to know if you can call your buddy in the United States right now or might want to wait another few hours to do so.</p>
<p>Local time can be very important in these circumstances and probably several else. There are a lot of software programs and browser add-ons that display multiple time zones to the user. <a href="http://www.ghacks.net/tag/firefox/">Firefox</a> users for example can install the excellent <a href="http://www.ghacks.net/2009/07/17/firefox-computer-alarm-clock-and-timer/">computer alarm clock and timer Simple Timer</a> which displays a clock in the Firefox status bar.</p>
<p><span id="more-16151"></span>Localti.me is an online service. The major benefit of it is the fact that it can be used to quickly look up the local time, local data and local weather without installing and software or plugin. All it takes is to enter a country, state or region to get the requested information. The service will display suggestions as soon as the user begins typing in the name.</p>
<p><img src="http://www.ghacks.net/wp-content/uploads/2009/09/local_date-500x277.jpg" alt="local date" title="local date" width="500" height="277" class="alignnone size-medium wp-image-16153" /></p>
<p>The results page will list the local time, local data and local weather along with other information about the selected location. These other information include maps (taken from Virtual Earth), Wikipedia information, the latest headlines, traveling information and pictures taken from Flickr and Panoramio.</p>
<p><img src="http://www.ghacks.net/wp-content/uploads/2009/09/local_weather-500x341.jpg" alt="local weather" title="local weather" width="500" height="341" class="alignnone size-medium wp-image-16154" /></p>
<p><a href="http://localti.me/">Localti.me</a> (via <a href="http://www.makeuseof.com/dir/localtime-current-local-time-around-the-world/">Make use of</a>) is a nice to have service for quickly looking up the local time, date or weather of a location in the world.</p>

	Tags: <a href="http://www.ghacks.net/tag/local-date/" title="local date" rel="tag">local date</a>, <a href="http://www.ghacks.net/tag/local-time/" title="local time" rel="tag">local time</a>, <a href="http://www.ghacks.net/tag/local-weather/" title="local weather" rel="tag">local weather</a>, <a href="http://www.ghacks.net/tag/look-up-local-time/" title="look up local time" rel="tag">look up local time</a>, <a href="http://www.ghacks.net/tag/time/" title="time" rel="tag">time</a>, <a href="http://www.ghacks.net/tag/timezone/" title="timezone" rel="tag">timezone</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/01/05/web-development-a-brief-history-of-time/" title="Web Development: A brief history of time() (January 5, 2009)">Web Development: A brief history of time()</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/03/08/microsoft-time-zone/" title="Microsoft Time Zone (March 8, 2009)">Microsoft Time Zone</a> (9)</li>
	<li><a href="http://www.ghacks.net/2009/03/16/installing-and-configuring-ntp-on-linux/" title="Installing and Configuring NTP on Linux (March 16, 2009)">Installing and Configuring NTP on Linux</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/09/09/look-up-local-time-date-and-weather-of-any-place-in-the-world/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Installing and Configuring NTP on Linux</title>
		<link>http://www.ghacks.net/2009/03/16/installing-and-configuring-ntp-on-linux/</link>
		<comments>http://www.ghacks.net/2009/03/16/installing-and-configuring-ntp-on-linux/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 14:07:04 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[ntp]]></category>
		<category><![CDATA[ntp.org]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[time server]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=11255</guid>
		<description><![CDATA[NTP is the Network Time Protocol. This protocol allows servers (or desktops) to communicate to very reliable sources to keep their time synchronized. There are two reasons why you would want to employ NTP: 1) You&#8217;re a geek and you want your time to be perfect. 2) You need your servers all synchronized with the [...]]]></description>
			<content:encoded><![CDATA[<p>NTP is the Network Time Protocol. This protocol allows servers (or desktops) to communicate to very reliable sources to keep their time synchronized. There are two reasons why you would want to employ NTP: 1) You&#8217;re a geek and you want your time to be perfect. 2) You need your servers all synchronized with the correct time.</p>
<p>Naturally the second reason is far more important than the first. But either way, you might very well be driven to keep your machine on the exact time. To that end you can either constantly monitor the time on your machine (manually changing it when necessary) or you can set up NTP to handle your time corrections for you.</p>
<p>Installing and configuring NTP is actually quite easy. It will, however, require the use of the command line. With that in mind, lets&#8217; get busy.</p>
<p><span id="more-11255"></span><strong>Installing</strong></p>
<p>You could open up your Add/Remove Software utility, do a search for &#8220;ntp&#8221; (no quotes) and install the matching results. Or you can open up a terminal window and install ntp with one of the following commands (remember, you will need either root access or sudo):</p>
<ul>
<li><em>apt-get install ntp </em></li>
<li><em>yum install ntp<br />
</em></li>
<li><em>urpmi ntp</em></li>
</ul>
<p>One of the above commands will install the ntp daemon and the configuration file <strong>/etc/ntp.conf</strong>.</p>
<p>Before you fire up the daemon you will need to take a look at the <strong>/etc/ntp.conf </strong>to make sure you have the ntp servers you want to use configured.</p>
<p><strong>Configuring</strong></p>
<p>Most likely your NTP installation will already have a configuration file that is ready to go. My Debian-based NTP install had such a .conf file. All I had to do was start the daemon. But you might have special needs or your install might not have been as complete.</p>
<p>The section of the <strong>ntp.conf</strong> that you will want to take a look at is the server section. Each line in this section is set up like so:</p>
<p><em>server IP_ADDRESS OPTION(S)</em></p>
<p>Where<em> IP_ADDRESS</em> is the actual address of the server you want to use and <em>OPTION(S)</em> is/are the option(s) you want to use.</p>
<p>There are two options that you might want to use for every server. These are:</p>
<p><strong>iburst</strong>: This option is used when the configured server is unreachable. When your machine can not contact its NTP server it will send out bursts of eight packets (instead of just one).</p>
<p><strong>dynamic</strong>: This option allows a server to be configured even if the server is not reachable during configuration. This option assumes that at some point the server will be reachable.</p>
<p>If you look at my <strong>/etc/ntp.conf</strong> file you will see the following in the server section:</p>
<p><code>server 0.debian.pool.ntp.org iburst dynamic<br />
server 1.debian.pool.ntp.org iburst dynamic<br />
server 2.debian.pool.ntp.org iburst dynamic<br />
server 3.debian.pool.ntp.org iburst dynamic</code></p>
<p>If you are not sure what servers to use visit the official NTP organization <a title="NTP.org" href="http://www.ntp.org" target="_blank">NTP.org</a> to find a list of trusted servers.</p>
<p><strong>Starting the Daemon</strong></p>
<p>Once you have everything up and running go back to the root terminal and issue the command:</p>
<p><em>/etc/init.d/ntp start</em></p>
<p>or</p>
<p><em>/etc/rc.d/init.d/ntp start</em></p>
<p>which will start the ntp daemon. NTP will now slowly start to adjust the time on your server. But don&#8217;t worry, it makes the adjustment slowly. First the daemon waits for at least ten packets of information before trusting a source.</p>
<p>Now test to make sure your installation is working by issuing the following command:</p>
<p><em>ntpq -p</em></p>
<p>which should give you a listing like:<br />
<code>remote           refid      st t when poll reach   delay   offset  jitter =========================================================<br />
+point2.adamants 64.202.112.75    2 u   44   64  377   75.955   -7.045   2.992<br />
*station.mars.or 209.81.9.7       2 u   10   64  377   75.477   -1.144   0.977<br />
-www.broadbandja 64.34.180.101    3 u   56   64  377   72.764    3.766   0.977<br />
+pxe.lax-noc.com 209.81.9.7       2 u   25   64  377   65.686   -7.753   2.539</code></p>
<p>If you see zeros for the values you know ntp is not connecting. As you can see above my setup is connecting.</p>
<p><strong>Final thoughts</strong></p>
<p>NTP is an easy way to ensure your servers or your desktop is always using the correct time. In mission-critical machines, this can be quite important. Employing NTP will give you the security of knowing your machine&#8217;s right &#8220;on time&#8221;.</p>

	Tags: <a href="http://www.ghacks.net/tag/clock/" title="clock" rel="tag">clock</a>, <a href="http://www.ghacks.net/tag/debian/" title="Debian" rel="tag">Debian</a>, <a href="http://www.ghacks.net/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.ghacks.net/tag/ntp/" title="ntp" rel="tag">ntp</a>, <a href="http://www.ghacks.net/tag/ntporg/" title="ntp.org" rel="tag">ntp.org</a>, <a href="http://www.ghacks.net/tag/time/" title="time" rel="tag">time</a>, <a href="http://www.ghacks.net/tag/time-server/" title="time server" rel="tag">time server</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2008/12/11/thoughts-on-linux-migration/" title="Thoughts on Linux migration (December 11, 2008)">Thoughts on Linux migration</a> (16)</li>
	<li><a href="http://www.ghacks.net/2009/03/26/easy-debian-wireless-connections-with-wifi-wiz/" title="Easy Debian Wireless Connections with Wifi-Wiz (March 26, 2009)">Easy Debian Wireless Connections with Wifi-Wiz</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/03/08/adding-repositories-to-synaptic/" title="Adding Repositories to Synaptic (March 8, 2009)">Adding Repositories to Synaptic</a> (1)</li>
	<li><a href="http://www.ghacks.net/2008/02/07/yoggie-pico-personal-mobile-security-computer/" title="Yoggie PICO Personal Mobile Security Computer (February 7, 2008)">Yoggie PICO Personal Mobile Security Computer</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/10/30/with-ubuntu-9-10-arrives-wubi-9-10/" title="With Ubuntu 9.10 Arrives Wubi 9.10 (October 30, 2009)">With Ubuntu 9.10 Arrives Wubi 9.10</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/03/16/installing-and-configuring-ntp-on-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Web Development: A brief history of time()</title>
		<link>http://www.ghacks.net/2009/01/05/web-development-a-brief-history-of-time/</link>
		<comments>http://www.ghacks.net/2009/01/05/web-development-a-brief-history-of-time/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 10:28:50 +0000</pubDate>
		<dc:creator>Daniel Pataki</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[fucntions]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=9579</guid>
		<description><![CDATA[Part of the beauty of PHP to me is the number of really useful variables that are built in. Some of these might seem very odd at first, but once you start creating pages you will run into some problems which you&#8217;ll find can be solved by a function which seemed totally useless when you [...]]]></description>
			<content:encoded><![CDATA[<p>Part of the beauty of PHP to me is the number of really useful variables that are built in. Some of these might seem very odd at first, but once you start creating pages you will run into some problems which you&#8217;ll find can be solved by a function which seemed totally useless when you first heard of it. One of these functions for me was <em>time()</em>.</p>
<p>Echoing the <em>time()</em> function will give you the amount of time passed since the Unix Epoch in seconds. Say what? Epoch means a point in time chosen as the start of a period or an era and thus the Unix Epoch is January 1 1970 00:00:00 GMT. So echoing the <em>time()</em> function will give us &#8220;1230978041&#8243; at the time I&#8217;m writing this, meaning that 1,230,978,041 seconds have passed since then. So why is this useful to us?</p>
<p>Mathematically it gives us a much easier way of keeping track of time. Sure, 2008, Jan 15th might seem all nice and organized to you, but to calculate the days passed from the 15th of Januaray to the 17th we&#8217;s have to strip the numbers of &#8220;th&#8221;, and in more complicated cases perform a bunch of other string changes. Using time you can essentially assign a number value to any given second, making it much easier to use, especially as a counter.</p>
<p><span id="more-9579"></span></p>
<p>The place I use it most is to log out users of a website automatically after an inactivity period. When a user signs in I create all the session variables for him/her, and I also create one which holds the time his session should expire. The beauty of this whole system is that I do not need to know the actual time, I can just assign a value to the session variable like this:</p>
<p><em>$_SESSION['user']['time'] = time() +3600</em></p>
<p>This means that the user can stay logged in for 3,600 seconds (in other words an hour) from this moment in time. This is a very convenient way of defining expiration time, since you can think in terms of how long you want it to be, as opposed to trying to calculate a specific date and time.</p>
<p>When a user refreshes a page, or moves on to a new one, a script will check the value of the session variable. If the current time is smaller than the session variable, the user can stay logged in and I also usually prolong the session by another 3,600 seconds. This gives it the true &#8220;inactivity&#8221; aspect, since the user is allowed to stay logged in for more than an hour, as long as he/she is using the system. You could however choose not to prolong the session, in this case the user would have to log in again after one hour no matter what. In some high security systems this might be the way to go, or if you want the user to spend exactly one hour on a specific puzzle, there are many uses for everything. Needless to say that if the current time is more than the session variable the user is signed out.</p>
<p>Another common use for <em>time()</em> is to serve as the basis for generating a random ID, or character set, in other words, it can serve as a seed. A quite efficient way of creating a very random string would be to use <em>time()</em>, divide it by a random number generated between 0 and 9,999, add some random characters to it, and encode the whole thing using the SHA1 algorithm for example. Code-wise this is not as difficult or as long as it may sound, and it is pretty random and strong, although I am no security specialist.</p>
<p>if you have any cool uses for the<em> time()</em> function let us know in the comments!</p>

	Tags: <a href="http://www.ghacks.net/tag/fucntions/" title="fucntions" rel="tag">fucntions</a>, <a href="http://www.ghacks.net/tag/php/" title="php" rel="tag">php</a>, <a href="http://www.ghacks.net/tag/time/" title="time" rel="tag">time</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/03/29/wordpress-template-tags-you-should-know/" title="Wordpress template tags you should know (March 29, 2009)">Wordpress template tags you should know</a> (4)</li>
	<li><a href="http://www.ghacks.net/2009/01/02/web-development-standardizing-variables-to-code-faster/" title="Web Development: Standardizing variables to code faster (January 2, 2009)">Web Development: Standardizing variables to code faster</a> (18)</li>
	<li><a href="http://www.ghacks.net/2009/02/01/web-development-php-what-role-does-it-fill/" title="Web Development: PHP &#8211; what role does it fill (February 1, 2009)">Web Development: PHP &#8211; what role does it fill</a> (1)</li>
	<li><a href="http://www.ghacks.net/2009/01/08/web-development-how-does-php-work/" title="Web Development: How does PHP work? (January 8, 2009)">Web Development: How does PHP work?</a> (21)</li>
	<li><a href="http://www.ghacks.net/2009/03/16/web-development-roundup/" title="Web development roundup (March 16, 2009)">Web development roundup</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/01/05/web-development-a-brief-history-of-time/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
