@Test public void testGetDateAndTimeFromNull() { String[] dateAndTime = DateHelper.getDateAndTimeAsString(null); assertThat(dateAndTime[0]).isEqualTo(null); assertThat(dateAndTime[1]).isEqualTo(null); }
public static String[] getDateAndTimeAsString(Long timeStamp) { String[] dateAndTime = new String[2]; TimeZone zone = TimeZone.getTimeZone("CEST"); format.setTimeZone(zone); if (null != timeStamp) { Date regDate = new Date(timeStamp); String dateTimeAsString = format.format(regDate); String date = dateTimeAsString.substring(0, 10); String time = dateTimeAsString.substring(11, 19); dateAndTime[0] = date; dateAndTime[1] = time; } return dateAndTime; }
DateHelper { public static String[] getDateAndTimeAsString(Long timeStamp) { String[] dateAndTime = new String[2]; TimeZone zone = TimeZone.getTimeZone("CEST"); format.setTimeZone(zone); if (null != timeStamp) { Date regDate = new Date(timeStamp); String dateTimeAsString = format.format(regDate); String date = dateTimeAsString.substring(0, 10); String time = dateTimeAsString.substring(11, 19); dateAndTime[0] = date; dateAndTime[1] = time; } return dateAndTime; } }
DateHelper { public static String[] getDateAndTimeAsString(Long timeStamp) { String[] dateAndTime = new String[2]; TimeZone zone = TimeZone.getTimeZone("CEST"); format.setTimeZone(zone); if (null != timeStamp) { Date regDate = new Date(timeStamp); String dateTimeAsString = format.format(regDate); String date = dateTimeAsString.substring(0, 10); String time = dateTimeAsString.substring(11, 19); dateAndTime[0] = date; dateAndTime[1] = time; } return dateAndTime; }  }
DateHelper { public static String[] getDateAndTimeAsString(Long timeStamp) { String[] dateAndTime = new String[2]; TimeZone zone = TimeZone.getTimeZone("CEST"); format.setTimeZone(zone); if (null != timeStamp) { Date regDate = new Date(timeStamp); String dateTimeAsString = format.format(regDate); String date = dateTimeAsString.substring(0, 10); String time = dateTimeAsString.substring(11, 19); dateAndTime[0] = date; dateAndTime[1] = time; } return dateAndTime; }  static String[] getDateAndTimeAsString(Long timeStamp); }
DateHelper { public static String[] getDateAndTimeAsString(Long timeStamp) { String[] dateAndTime = new String[2]; TimeZone zone = TimeZone.getTimeZone("CEST"); format.setTimeZone(zone); if (null != timeStamp) { Date regDate = new Date(timeStamp); String dateTimeAsString = format.format(regDate); String date = dateTimeAsString.substring(0, 10); String time = dateTimeAsString.substring(11, 19); dateAndTime[0] = date; dateAndTime[1] = time; } return dateAndTime; }  static String[] getDateAndTimeAsString(Long timeStamp);  }