getCurrent__hhmmssiii static method

String getCurrent__hhmmssiii()

return format: hh:mm:ss:iii pages: 03:09:06:009

Implementation

static String getCurrent__hhmmssiii() {
  DateTime now = DateTime.now();

  //h
  String h = now.hour.toString();
  if(  now.hour < 10 ) {
    h = "0" + now.hour.toString();
  }

  //m
  String m = now.minute.toString();
  if(  now.minute < 10 ) {
    m = "0" + now.minute.toString();
  }

  //s
  String s = now.second.toString();
  if(  now.second < 10 ) {
    s = "0" + now.second.toString();
  }

  //i
  String i = now.millisecond.toString();
  if(  now.millisecond < 10 ) {
    i = "00" + now.millisecond.toString();
  } else if(  now.millisecond < 100 ) {
    i = "0" + now.millisecond.toString();
  }

  String timeStr = h + ":" + m + ":" + s + ":" + i ;
  return timeStr;
}