Location: PHPKode > scripts > SQL Time > sql-time/SQLTime.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class SQLTime</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class SQLTime</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">formates time between SQL time data-types (DATETIME, DATE, TIME) and UNIX time stamp</p>
	<ul class="tags">
				<li><span class="field">license:</span> <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a></li>
				<li><span class="field">author:</span> Michal &quot;Techi&quot; Vrchota 2004 &lt;<a href="mailto:hide@address.com">hide@address.com</a>&gt;</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_sqltime.php.html">/sqltime.php</a> (line <span class="field">16</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
												<div class="method-definition">
					static 						<span class="method-result">float</span>
										<a href="#DiffDays" title="details" class="method-name">DiffDays</a>
											(<span class="var-type">integer</span>&nbsp;<span class="var-name">$day1</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$day2</span>)
									</div>
																<div class="method-definition">
					static 						<span class="method-result">string</span>
										<a href="#Stamp2DATE" title="details" class="method-name">Stamp2DATE</a>
											(<span class="var-type">integer</span>&nbsp;<span class="var-name">$stamp</span>)
									</div>
																<div class="method-definition">
					static 						<span class="method-result">string</span>
										<a href="#Stamp2DATETIME" title="details" class="method-name">Stamp2DATETIME</a>
											(<span class="var-type">integer</span>&nbsp;<span class="var-name">$stamp</span>)
									</div>
																<div class="method-definition">
					static 						<span class="method-result">string</span>
										<a href="#Stamp2TIME" title="details" class="method-name">Stamp2TIME</a>
											(<span class="var-type">integer</span>&nbsp;<span class="var-name">$stamp</span>)
									</div>
																<div class="method-definition">
					static 						<span class="method-result">mixed</span>
										<a href="#Time2Stamp" title="details" class="method-name">Time2Stamp</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$datetime</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$format</span> = <span class="var-default">&quot;&quot;</span>])
									</div>
								
																																												</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodDiffDays" id="DiffDays"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">static method DiffDays</span> (line <span class="line-number">139</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Computes difference in days</p>
	<ul class="tags">
				<li><span class="field">return:</span> number of days</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">float</span>
		<span class="method-name">
			DiffDays
		</span>
					(<span class="var-type">integer</span>&nbsp;<span class="var-name">$day1</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$day2</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$day1</span><span class="var-description">: unix timestamp</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$day2</span><span class="var-description">: unix timestamp</span>			</li>
				</ul>
		
			
	</div>
<a name="methodStamp2DATE" id="Stamp2DATE"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">static method Stamp2DATE</span> (line <span class="line-number">113</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">converts UNIX time stamp to SQL-DATE</p>
	<ul class="tags">
				<li><span class="field">return:</span> DATE</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">string</span>
		<span class="method-name">
			Stamp2DATE
		</span>
					(<span class="var-type">integer</span>&nbsp;<span class="var-name">$stamp</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$stamp</span><span class="var-description">: unix timestamp</span>			</li>
				</ul>
		
			
	</div>
<a name="methodStamp2DATETIME" id="Stamp2DATETIME"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">static method Stamp2DATETIME</span> (line <span class="line-number">100</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">converts UNIX time stamp to SQL-DATETIME</p>
	<ul class="tags">
				<li><span class="field">return:</span> DATETIME</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">string</span>
		<span class="method-name">
			Stamp2DATETIME
		</span>
					(<span class="var-type">integer</span>&nbsp;<span class="var-name">$stamp</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$stamp</span><span class="var-description">: unix timestamp</span>			</li>
				</ul>
		
			
	</div>
<a name="methodStamp2TIME" id="Stamp2TIME"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">static method Stamp2TIME</span> (line <span class="line-number">126</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">converts UNIX time stamp to SQL-TIME</p>
	<ul class="tags">
				<li><span class="field">return:</span> TIME</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">string</span>
		<span class="method-name">
			Stamp2TIME
		</span>
					(<span class="var-type">integer</span>&nbsp;<span class="var-name">$stamp</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$stamp</span><span class="var-description">: unix timestamp</span>			</li>
				</ul>
		
			
	</div>
<a name="methodTime2Stamp" id="Time2Stamp"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">static method Time2Stamp</span> (line <span class="line-number">27</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">converts SQL datetime format to UNIX time stamp or format by Date() if the second parameter is specified</p>
	<ul class="tags">
				<li><span class="field">return:</span> integer (timestamp) if $format is empty, otherwise formated string</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">mixed</span>
		<span class="method-name">
			Time2Stamp
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$datetime</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$format</span> = <span class="var-default">&quot;&quot;</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$datetime</span><span class="var-description">: DATE, TIME or DATETIME format</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$format</span><span class="var-description">: directly format the time using Date() function</span>			</li>
				</ul>
		
			
	</div>

						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Thu, 12 Oct 2006 01:53:46 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0</a>
	</p>
	</div></body>
</html>
Return current item: SQL Time