dateTimeSeparate static method

String dateTimeSeparate(
  1. String time,
  2. String? dateSeparate,
  3. String? timeSeparate
)

分隔符转换.

Implementation

static String dateTimeSeparate(String time, String? dateSeparate, String? timeSeparate) {
  if (dateSeparate != null) {
    time = time.replaceAll("-", dateSeparate);
  }
  if (timeSeparate != null) {
    time = time.replaceAll(":", timeSeparate);
  }
  return time;
}