PHP/mySQL日期/时间计算(OTRS)

PHP/mySQL日期/时间计算(OTRS),php,mysql,otrs,Php,Mysql,Otrs,我正试图将几个PHP页面组合起来,作为OTR的仪表板。其想法是将其输出到办公室的显示器上,以显示接近首次响应和更新升级的票证。到目前为止,我不是一个挣扎在这件事上的开发人员。我已经设法让它只输出设置了升级时间的票据…太好了!但是我想显示升级之前的时间。这就是我完全不懂的地方。我曾试图在php/mysql指南中混淆视听,但运气不好 到目前为止,我已经包含了我的代码……不仅仅是希望有人能为我指明添加“升级时间”列的方向(我猜这涉及到根据当前日期/时间操纵升级更新时间(Unix)),但它也可以帮助别人

我正试图将几个PHP页面组合起来,作为OTR的仪表板。其想法是将其输出到办公室的显示器上,以显示接近首次响应和更新升级的票证。到目前为止,我不是一个挣扎在这件事上的开发人员。我已经设法让它只输出设置了升级时间的票据…太好了!但是我想显示升级之前的时间。这就是我完全不懂的地方。我曾试图在php/mysql指南中混淆视听,但运气不好

到目前为止,我已经包含了我的代码……不仅仅是希望有人能为我指明添加“升级时间”列的方向(我猜这涉及到根据当前日期/时间操纵升级更新时间(Unix)),但它也可以帮助别人做同样的事情,我正试图实现…这将是非常有用的!(obv更改了IP/用户名/通行证)

综上所述;理想情况下,我想添加到以下脚本中的内容是:

能够以标准日期/时间格式(而不是Unix)显示上报时间 在升级前显示倒计时的功能,例如每张票显示3小时15分钟或2天3小时14分钟等

我想这并不是特定于OTR的,并且适用于任何mySQL/PHP环境,所以希望有一个能干的孩子能够理解这些东西

提前感谢您提供的任何指导或帮助:)

OTRS-第一次接触

您应该尝试使用php date()和strotime()函数。对于倒计时选项,我认为您应该更改aproach:如果使用Perl和,可以使用TicketSearch对象,它允许您搜索升级时间:

    # you can use all following escalation options with this four different ways of escalations
    # TicketEscalationTime...
    # TicketEscalationUpdateTime...
    # TicketEscalationResponseTime...
    # TicketEscalationSolutionTime...

    # ticket escalation time of more than 60 minutes ago (optional)
    TicketEscalationTimeOlderMinutes => -60,
    # ticket escalation time of less than 120 minutes ago (optional)
    TicketEscalationTimeNewerMinutes => -120,

    # tickets with escalation time after ... (optional)
    TicketEscalationTimeNewerDate => '2006-01-09 00:00:01',
    # tickets with escalation time before ... (optional)
    TicketEscalationTimeOlderDate => '2006-01-09 23:59:59',
    # you can use all following escalation options with this four different ways of escalations
    # TicketEscalationTime...
    # TicketEscalationUpdateTime...
    # TicketEscalationResponseTime...
    # TicketEscalationSolutionTime...

    # ticket escalation time of more than 60 minutes ago (optional)
    TicketEscalationTimeOlderMinutes => -60,
    # ticket escalation time of less than 120 minutes ago (optional)
    TicketEscalationTimeNewerMinutes => -120,

    # tickets with escalation time after ... (optional)
    TicketEscalationTimeNewerDate => '2006-01-09 00:00:01',
    # tickets with escalation time before ... (optional)
    TicketEscalationTimeOlderDate => '2006-01-09 23:59:59',