package com.inspect.ivs.util;

import com.inspect.base.core.utils.DateUtils;

public class TimeUtils {
   private static final String SIP_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
   private static final String IVS_TIME_FORMAT;

   public static String toSip(String ivsTime) {
      return DateUtils.parseDateToStr(SIP_TIME_FORMAT, DateUtils.dateTime(IVS_TIME_FORMAT, ivsTime)).replace(" ", "T") + "Z";
   }

   public static String toIvs(String sipTime) {
      String replace = sipTime.replace("-", "").replace("T", "").replace("Z", "").replace(":", "");
      return replace;
   }

   static {
      IVS_TIME_FORMAT = DateUtils.YYYYMMDDHHMMSS;
   }
}
