doutongwei4380 2012-04-04 15:39
浏览 24
已采纳

在PHP中的小时计算

I have project in which user gets specific number of hours for month respective to their subscription and if he had some hours remains at the end of month his remaining hours would be added in next month hours. For example if the user is subscribed to 1400 hours subscription and he has 20 hours left at the end of month so in the next month he get 1420 hours. However in my database hours are stored in this form 1400:00:00 so i get the value 20:00:00 how do i add 1400:00:00.

  • 写回答

1条回答 默认 最新

  • dsmlf1207915 2012-04-04 15:42
    关注
    $string = '1400:00:00';
    
    $explode = explode(':',$string);
    
    $hours = $explode[0];
    
    $new_hours = $hours + 20;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法