⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 function.px-timestamp2string.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Converts the timestamp into a string.</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.px-set-value.html">px_set_value</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.px-update-record.html">px_update_record</a></div> <div class="up"><a href="ref.paradox.html">Paradox Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.px-timestamp2string" class="refentry"> <div class="refnamediv">  <h1 class="refname">px_timestamp2string</h1>  <p class="verinfo">(PECL paradox:1.4.0-1.4.1)</p><p class="refpurpose"><span class="refname">px_timestamp2string</span> &mdash; <span class="dc-title">   Converts the timestamp into a string.  </span></p> </div> <div class="refsect1 description">  <h3 class="title">Description</h3>  <div class="methodsynopsis dc-description">   <span class="type">string</span> <span class="methodname"><b><b>px_timestamp2string</b></b></span>    ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$pxdoc</tt></span>   , <span class="methodparam"><span class="type">float</span> <tt class="parameter">$value</tt></span>   , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$format</tt></span>   )</div>  <p class="para rdfs-comment">   Turns a timestamp as it stored in the paradox file into human readable   format. Paradox timestamps are the number of milliseconds since 1.1.0000.   This function is just for convenience. It can be easily replaced by some   math and the calendar functions as demonstrated in the following example.  </p> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt>     <span class="term"><i><tt class="parameter">pxdoc</tt></i></span>     <dd>      <p class="para">       Resource identifier of the paradox database.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">value</tt></i></span>     <dd>      <p class="para">       Value as stored in paradox database field of type       PX_FIELD_TIME, or PX_FIELD_TIMESTAMP.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">format</tt></i></span>     <dd>      <p class="para">        String format similar to the format used by <a href="function.date.html" class="function">date()</a>.        The placeholders support by this function is a subset of those        supported by <a href="function.date.html" class="function">date()</a> (Y, y, m, n, d, j, H, h, G, g,        i, s, A, a, L).      </p>     </dd>    </dt>   </dl>  </p> </div> <div class="refsect1 returnvalues">  <h3 class="title">Return Values</h3>  <p class="para">   Returns <b><tt>TRUE</tt></b> on success or <b><tt>FALSE</tt></b> on failure.  </p> </div>   <div class="refsect1 examples">  <h3 class="title">Examples</h3>  <p class="para">   <div class="example">    <p><b>Example #1 Turn a paradox timestamp into a human readable form</b></p>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$px&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">px_new</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/*&nbsp;make&nbsp;up&nbsp;a&nbsp;date&nbsp;as&nbsp;it&nbsp;could&nbsp;be&nbsp;stored&nbsp;in&nbsp;*/<br />/*&nbsp;a&nbsp;date&nbsp;field&nbsp;of&nbsp;a&nbsp;paradox&nbsp;db.&nbsp;*/<br />/*&nbsp;700000&nbsp;days&nbsp;since&nbsp;1.1.0000.&nbsp;*/<br /></span><span style="color: #0000BB">$days&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">700000</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">/*&nbsp;Use&nbsp;the&nbsp;calendar&nbsp;functions&nbsp;to&nbsp;print&nbsp;a&nbsp;*/<br />/*&nbsp;human&nbsp;readable&nbsp;format&nbsp;of&nbsp;the&nbsp;date&nbsp;*/<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">jdtogregorian</span><span style="color: #007700">(</span><span style="color: #0000BB">$days</span><span style="color: #007700">+</span><span style="color: #0000BB">1721425</span><span style="color: #007700">).</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">/*&nbsp;Turn&nbsp;it&nbsp;into&nbsp;a&nbsp;timestamp&nbsp;as&nbsp;it&nbsp;stored&nbsp;in&nbsp;a&nbsp;paradox&nbsp;database&nbsp;*/<br />/*&nbsp;Timestamps&nbsp;are&nbsp;stored&nbsp;in&nbsp;milli&nbsp;seconds&nbsp;since&nbsp;1.1.0000&nbsp;*/<br /></span><span style="color: #0000BB">$stamp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$days&nbsp;</span><span style="color: #007700">*&nbsp;</span><span style="color: #0000BB">86400.0&nbsp;</span><span style="color: #007700">*&nbsp;</span><span style="color: #0000BB">1000.0</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">/*&nbsp;Add&nbsp;one&nbsp;hour&nbsp;*/<br /></span><span style="color: #0000BB">$stamp&nbsp;</span><span style="color: #007700">+=&nbsp;</span><span style="color: #0000BB">3600000.0</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">/*&nbsp;The&nbsp;following&nbsp;will&nbsp;output&nbsp;'7/15/1917&nbsp;01:00:00'.&nbsp;*/<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">px_timestamp2string</span><span style="color: #007700">(</span><span style="color: #0000BB">$px</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$stamp</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"n/d/Y&nbsp;H:i:s"</span><span style="color: #007700">).</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">px_delete</span><span style="color: #007700">(</span><span style="color: #0000BB">$px</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>    </div>    <div class="example-contents"><p>The above example will output:</p></div>    <div class="example-contents"><pre><div class="cdata"><pre>7/15/19177/15/1917 01:00:00</pre></div>    </pre></div>   </div>  </p>  <p class="para">    The Julian day count as passed to <a href="function.jdtogregorian.html" class="function">jdtogregorian()</a>    has a different base of 1.1.4714 b.c. and must therefore be calculated    by adding 1721425 to the day count used in the paradox file. Turning the    day count into a timestamp is easily done by multiplying with 86400000.0    to obtain milli seconds.  </p> </div> <div class="refsect1 seealso">  <h3 class="title">See Also</h3>  <p class="para">   <ul class="simplelist">    <li class="member"><a href="function.px-date2string.html" class="function" rel="rdfs-seeAlso">px_date2string()</a></li>    <li class="member"><a href="function.jdtogregorian.html" class="function" rel="rdfs-seeAlso">jdtogregorian()</a></li>   </ul>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.px-set-value.html">px_set_value</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.px-update-record.html">px_update_record</a></div> <div class="up"><a href="ref.paradox.html">Paradox Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -