• 时间+数字的处理


    1.sql处理(postgersql)

    case when A = 0 or B is null
    then array_to_string(startTime, ':')
    else case
    when char_length(
    CAST( (startTime [1] ::integer) + floor( ( (startTime [2] ::integer) + round(B / A)) / 60) as VARCHAR)) > 2
    then concat( ( (startTime [1] ::integer) + floor( ( (startTime [2] ::integer) + round(B / A)) / 60)) , ':', lpad( cast( COALESCE( mod( (startTime [2] ::integer) + round(B / A), 60) , 00) as VARCHAR) , 2, '0'))
    else concat( lpad( CAST( COALESCE( (startTime [1] ::integer) + floor( ( (startTime [2] ::integer) + round(B / A)) / 60) , 00) as VARCHAR) , 2, '0') , ':', lpad( cast( COALESCE( mod( (startTime [2] ::integer) + round(B / A), 60) , 00) as VARCHAR) , 2, '0'))
    end
    end as endTime

    2.java代码处理

    function timeFormat(numStr) {
      if (numStr == undefined || numStr.length == 0) return '';
        if (numStr == '0'){
          return '0';
        }else{
        if(numStr%60<10){
          return parseInt(numStr/60)+":0"+numStr%60;
        }else{
          return parseInt(numStr/60)+":"+numStr%60;
        }
      }
    }

  • 相关阅读:
    matlab简单线性规划&单纯形法
    matlab多变量绘图函数(类似ggplot2)
    matlab近似泛函优化
    如何求矩阵的逆矩阵
    数值分析手写笔记
    latex绘图小结
    数理统计手写笔记
    matlab kriging模型
    运筹学与最优化手写笔记
    matlab既约梯度法习题
  • 原文地址:https://www.cnblogs.com/renxinghua/p/14467096.html
Copyright © 2020-2023  润新知