<bdo id='wsUjA'></bdo><ul id='wsUjA'></ul>

    <legend id='wsUjA'><style id='wsUjA'><dir id='wsUjA'><q id='wsUjA'></q></dir></style></legend>
    1. <i id='wsUjA'><tr id='wsUjA'><dt id='wsUjA'><q id='wsUjA'><span id='wsUjA'><b id='wsUjA'><form id='wsUjA'><ins id='wsUjA'></ins><ul id='wsUjA'></ul><sub id='wsUjA'></sub></form><legend id='wsUjA'></legend><bdo id='wsUjA'><pre id='wsUjA'><center id='wsUjA'></center></pre></bdo></b><th id='wsUjA'></th></span></q></dt></tr></i><div id='wsUjA'><tfoot id='wsUjA'></tfoot><dl id='wsUjA'><fieldset id='wsUjA'></fieldset></dl></div>
    2. <small id='wsUjA'></small><noframes id='wsUjA'>

      <tfoot id='wsUjA'></tfoot>

      如何比较两个 Zend_Date 对象的日期部分?

      时间:2023-10-02

      <i id='8J7Wk'><tr id='8J7Wk'><dt id='8J7Wk'><q id='8J7Wk'><span id='8J7Wk'><b id='8J7Wk'><form id='8J7Wk'><ins id='8J7Wk'></ins><ul id='8J7Wk'></ul><sub id='8J7Wk'></sub></form><legend id='8J7Wk'></legend><bdo id='8J7Wk'><pre id='8J7Wk'><center id='8J7Wk'></center></pre></bdo></b><th id='8J7Wk'></th></span></q></dt></tr></i><div id='8J7Wk'><tfoot id='8J7Wk'></tfoot><dl id='8J7Wk'><fieldset id='8J7Wk'></fieldset></dl></div>

        1. <legend id='8J7Wk'><style id='8J7Wk'><dir id='8J7Wk'><q id='8J7Wk'></q></dir></style></legend>

          • <bdo id='8J7Wk'></bdo><ul id='8J7Wk'></ul>

            <small id='8J7Wk'></small><noframes id='8J7Wk'>

              <tbody id='8J7Wk'></tbody>
            <tfoot id='8J7Wk'></tfoot>
                本文介绍了如何比较两个 Zend_Date 对象的日期部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我想检查 Zend_Date 日期时间是否在同一天.我该怎么做?

                I'd like to check if to Zend_Date datetimes are on the same day. How can I do that?

                $date1 = new Zend_Date('2011-11-14 10:45:00');
                $date2 = new Zend_Date('2011-11-14 19:15:00');
                

                推荐答案

                $date1 = new Zend_Date('2011-11-14 10:45:00');
                $date2 = new Zend_Date('2011-11-14 19:15:00');
                if ($date1->compareDay($date2) === 0) {
                    echo 'same day';
                }
                

                另见关于将日期与 Zend 日期进行比较

                在旁注中,我强烈建议您验证是否需要 Zend_Date.不要仅仅因为它是 ZF 的一部分就使用它.使用原生 可以更快、更舒适地实现 Zend_Date 所做的大部分事情DateTime 也是:

                On a sidenote, I strongly encourage you to verify if you have the need for Zend_Date. Do not use it just because it is part of ZF. Most of what Zend_Date does can be achieved faster and more comfortably with native DateTime as well:

                $date1 = new DateTime('2011-11-14 10:45:00');
                $date2 = new DateTime('2011-11-14 19:15:00');
                if ($date1->diff($date2)->days === 0) {
                    echo 'same day';
                }
                

                <小时>

                评论后编辑
                如果你想比较它是否是相同的日期就做


                EDIT after comments
                If you want to compare whether it's the same date just do

                $date1->compareDate($date2)
                

                这篇关于如何比较两个 Zend_Date 对象的日期部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:将 3rd 方库添加到 ZendFramework 下一篇:“与 MySQL 服务器的连接丢失"尝试连接到远程

                相关文章

                最新文章

                <legend id='tNO75'><style id='tNO75'><dir id='tNO75'><q id='tNO75'></q></dir></style></legend>

                1. <tfoot id='tNO75'></tfoot>

                  <i id='tNO75'><tr id='tNO75'><dt id='tNO75'><q id='tNO75'><span id='tNO75'><b id='tNO75'><form id='tNO75'><ins id='tNO75'></ins><ul id='tNO75'></ul><sub id='tNO75'></sub></form><legend id='tNO75'></legend><bdo id='tNO75'><pre id='tNO75'><center id='tNO75'></center></pre></bdo></b><th id='tNO75'></th></span></q></dt></tr></i><div id='tNO75'><tfoot id='tNO75'></tfoot><dl id='tNO75'><fieldset id='tNO75'></fieldset></dl></div>
                  1. <small id='tNO75'></small><noframes id='tNO75'>

                      <bdo id='tNO75'></bdo><ul id='tNO75'></ul>