<?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 &#124; Latest Tech News, Software And Tutorials &#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 news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Fri, 10 Feb 2012 09:07:37 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Sunrise, Sunset, Twilight, Moonrise and Moonset Times</title><link>http://www.ghacks.net/2011/11/19/sunrise-sunset-twilight-moonrise-and-moonset-times/</link> <comments>http://www.ghacks.net/2011/11/19/sunrise-sunset-twilight-moonrise-and-moonset-times/#comments</comments> <pubDate>Sat, 19 Nov 2011 16:41:34 +0000</pubDate> <dc:creator>Martin Brinkmann</dc:creator> <category><![CDATA[Browsing]]></category> <category><![CDATA[Firefox]]></category> <category><![CDATA[firefox add-ons]]></category> <category><![CDATA[local time]]></category> <category><![CDATA[time]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=52865</guid> <description><![CDATA[Even if you are living in a big city like me, you sometimes need to know the times the sun or moon rises and sets. Maybe you want to photograph the sun or moon at a specific time, go fishing or believe in something that requires you to know the exact times. Or, you simply [...]]]></description> <content:encoded><![CDATA[<p>Even if you are living in a big city like me, you sometimes need to know the times the sun or moon rises and sets. Maybe you want to photograph the sun or moon at a specific time, go fishing or believe in something that requires you to know the exact times. Or, you simply want to be prepared for the full moon everyone is going crazy periods. Whatever it is, the Firefox add-on Sun Cult makes it dead easy to tell.</p><p>The extension supports both sun and moon times, and in particular sunrise, sunset, twilight, moonrise and moonset times. Your first task after downloading and installing the extension, and restarting the web browser, is to add a specific location to the extension.</p><p><a
href="http://www.ghacks.net/wp-content/uploads/2011/11/sunrise-sunset-moonrise-moonset-twilight.jpg"><img
src="http://www.ghacks.net/wp-content/uploads/2011/11/sunrise-sunset-moonrise-moonset-twilight.jpg" alt="sunrise sunset moonrise moonset twilight" title="sunrise sunset moonrise moonset twilight" width="422" height="271" class="alignnone size-full wp-image-52866" /></a></p><p>The extension ships with a continent > country > city lists. If you are lucky, your city or a big city nearby is listed in the configuration menu. You only need to select the city in this case to make it the city you get the sun and moon times information from.</p><p>If you cannot find your city or town in the list, you need to add latitude and longitude coordinates manually. You can use a service like <a
href="http://www.thegpscoordinates.com/">GPS Coordinates</a> to get those coordinates. Just enter them on the Sun Cult configuration screen and click ok to complete the configuration.</p><p>You can alternatively switch to Time to configure the time zone and format settings, as well as sunrise, sunset and twilight times. The Display tab finally determines the type of information and their placement in the Firefox browser.</p><p><a
href="http://www.ghacks.net/wp-content/uploads/2011/11/sun-cult.jpg"><img
src="http://www.ghacks.net/wp-content/uploads/2011/11/sun-cult.jpg" alt="sun cult" title="sun cult" width="337" height="322" class="alignnone size-full wp-image-52867" /></a></p><p>The extension by default displays Twilight start, Twilight end, Sunrise and Sunset, as well as Moonrise, Moonset, the Moon Phase and the next full moon.</p><p>Additional times that are not displayed by default are Sunrise and Sunset azimuth, high noon, next new moon and Moonrise and Moonset azimuth. All information can be enabled or disabled selectively. It is also possible to change the location of the information from the status bar to another location like another toolbar.</p><p>Firefox users can download and install Sun Cult <a
href="https://addons.mozilla.org/en-US/firefox/addon/sun-cult/?src=cb-dl-updated">from the</a> official Mozilla Firefox add-on repository.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2011/11/19/sunrise-sunset-twilight-moonrise-and-moonset-times/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Setting your computer time in Ubuntu</title><link>http://www.ghacks.net/2010/10/05/setting-your-computer-time-in-ubuntu/</link> <comments>http://www.ghacks.net/2010/10/05/setting-your-computer-time-in-ubuntu/#comments</comments> <pubDate>Tue, 05 Oct 2010 13:58:56 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[date]]></category> <category><![CDATA[GNOME]]></category> <category><![CDATA[ntp]]></category> <category><![CDATA[time]]></category> <category><![CDATA[ubuntu]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=35576</guid> <description><![CDATA[You computer&#8217;s clock does more than just tell you the time. This clock also stamps your email with the correct time as well as documents and much more. So when your PC clock is off, your life is off (at least while you are working). So it is necessary to keep your machine time accurate. [...]]]></description> <content:encoded><![CDATA[<p>You computer&#8217;s clock does more than just tell you the time. This clock also stamps your email with the correct time as well as documents and much more. So when your PC clock is off, your life is off (at least while you are working). So it is necessary to keep your machine time accurate. But how do you do this? Besides making sure your hardware clock is correct (which is commonly done through the BIOS settings), you need to know how to set the time.</p><p>In this article I am going to show you how to change the time on your Ubuntu machine using both the GUI and the command line. Hopefully, when you&#8217;re done with this, your computer clock will always be accurate.</p><p><span
id="more-35576"></span><strong>Another option</strong></p><p>Of course there is always another option. You can always set up NTP on your machine. I have already covered this in my article &#8220;<a
title="Installing and configuring NTP on Linux" href="http://www.ghacks.net/2009/03/16/installing-and-configuring-ntp-on-linux/" target="_blank">Installing and configuring NTP on Linux</a>&#8220;. That is, by far, the most reliable way to manage your clock. But when you don&#8217;t have constant access to the internet, or you simply don&#8217;t want to install a daemon on your machine &#8211; you have to resort to other methods. Let&#8217;s take a look at them here.</p><p><strong>Command line</strong></p><p>In order to set the date from the command line, you use the <em>date</em> command. The date command, however, is not the simplest command to figure out &#8211; at least not from the man page. If you look at the man page for <em>date</em> you see the time format uses a specific time string format like:</p><p><em>MMDDhhmmYYYY.ss</em></p><p>What the above string means is:</p><p><em> </em></p><p><em> </em></p><p><em> </em></p><ul><li>MM<span
style="font-style: normal"> is a two digit month, between 01 to 12.</span></li><li>DD<span
style="font-style: normal"> is a two digit day, between 01 and 31. NOTE: Regular rules for days, according to month and year, apply.</span></li><li><span
style="font-style: normal"><em>hh</em> is two digit hour, using the 24-hour period so it is between 00 and 23.</span></li><li><span
style="font-style: normal"><em>mm</em> is two digit minute, between 00 and 59.</span></li><li>YYYY<span
style="font-style: normal"> is the year; it can be two digit or four digit: your choice. </span></li><li><span
style="font-style: normal"><em>ss</em> is two digit seconds. The period (&#8220;.&#8221;) before the ss is necessary.</span></li></ul><p>So, let&#8217;s say you want to set the correct date and time for this exact moment (the moment I am writing, not your reading). To do this I would enter the command:</p><p><code>sudo date 100507492010.00</code></p><p>at which point you would be returned:</p><p><code>Tue Oct 5 07:50:00 EDT 2010</code></p><p><strong>GUI</strong></p><div
id="attachment_35589" class="wp-caption alignleft" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2010/10/time_date_gui.png"><img
class="size-medium wp-image-35589 " src="http://www.ghacks.net/wp-content/uploads/2010/10/time_date_gui-500x294.png" alt="" width="300" height="176" /></a><p
class="wp-caption-text">Figure 1</p></div><p>Now, let&#8217;s take a look and see how this is done from the graphical front end. To do this click <strong>System &gt; Administration &gt; Time and Date</strong>. When you do this you will have to click the &#8220;lock&#8221; button to unlock this tool for changes. When you click this you will have to enter your sudo password. Upon proper authentication you will then be able to use the drop downs for hours, minutes, and seconds. When you change the time, you only need to close the tool, no saving required. NOTE: You can also change the date as well as the timezone with this same tool.</p><p><strong>Final thoughts</strong></p><p>Don&#8217;t be caught in the future or the past on Linux. Make sure your time is correct so you aren&#8217;t confusing those receiving your emails (unless you want them to think they are receiving emails from &#8220;future you&#8221;.)</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/10/05/setting-your-computer-time-in-ubuntu/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>New Zealand iPhones hit by daylight saving bug</title><link>http://www.ghacks.net/2010/09/27/new-zealand-iphones-hit-by-daylight-saving-bug/</link> <comments>http://www.ghacks.net/2010/09/27/new-zealand-iphones-hit-by-daylight-saving-bug/#comments</comments> <pubDate>Mon, 27 Sep 2010 07:00:16 +0000</pubDate> <dc:creator>Mike Halsey MVP</dc:creator> <category><![CDATA[Apple]]></category> <category><![CDATA[clock]]></category> <category><![CDATA[daylight saving]]></category> <category><![CDATA[io1]]></category> <category><![CDATA[ios 4.1]]></category> <category><![CDATA[iPhone]]></category> <category><![CDATA[new zealand]]></category> <category><![CDATA[time]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=35270</guid> <description><![CDATA[It has been reported that iPhones in New Zealand running the iOS 4.1 software have been hit by a bug as the country changes daylight saving time. The error caused the times on phones to revert back two hours instead of just one.  This resulted in one disgruntled iPhone user being awoken at 3am instead of [...]]]></description> <content:encoded><![CDATA[<p>It has been <a
href="http://www.iphonewzealand.co.nz/2010/all/iphone-alarm-borked-by-daylight-savings/" target="_blank">reported</a> that iPhones in New Zealand running the iOS 4.1 software have been hit by a bug as the country changes daylight saving time.</p><p>The error caused the times on phones to revert back two hours instead of just one.  This resulted in one disgruntled iPhone user being awoken at 3am instead of 5am, and a great many more complaints from users on Twitter.</p><p>In his blog the disgruntled user said&#8230;</p><blockquote><p>I am tired and I am grumpy. And it’s my iPhone’s fault! Yes, folks, as if losing an hour’s sleep due to daylight savings isn’t bad enough, how about losing another hour just for good measure? It seems that Apple have borked something with the alarm clock and despite the clock on my iPhone being correctly set, the alarm I had scheduled for 5:55am went off at 4:55am this morning, which is basically 3:55am until my body clock adjusts. Unfortunately my tired brain didn’t spot the critical flaw in the Matrix and now I’m seriously hacked off. But the plot thickens upon further investigation…</p></blockquote><p>It&#8217;s not the first time a device has been hit by a daylight savings bug.  Microsoft&#8217;s Zune players once famously failed to operate for a full 24 hours as they didn&#8217;t recognise the date as a valid day.  Microsoft couldn&#8217;t have issued a patch in time as when the clocks ticked over to midnight again, everything started working properly.</p><p>It&#8217;s far too early for Apple to issue a comment or to say if the same bug will hit other countries when they switch from summer time in a few weeks, after all, when the bug hit people in Cupertino were just getting ready for bed.  We can be dertain though that a patch will be issued, but perhaps not before the bug has had a chance to strike again.</p><p>It&#8217;s not known whether this is local to New Zealand but if you have an iPhone and use its alarm when daylight savings time changes next, you might want to go back to your trusty old clock radio for the night.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/09/27/new-zealand-iphones-hit-by-daylight-saving-bug/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <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 Brinkmann</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>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. Firefox 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> ]]></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> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/03/16/installing-and-configuring-ntp-on-linux/feed/</wfw:commentRss> <slash:comments>4</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> ]]></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>
