@Test public void getCurrentDateTime() throws Exception { final String result = DateTimeService.getCurrentDateTime("unix", "DK", null, null); String currentTimeUnix = String.valueOf(DateTime.now().getMillis() / Constants.Miscellaneous.THOUSAND_MULTIPLIER); assertFalse(result.isEmpty()); assertTrue(result.startsWith(currentTimeUnix.substring(0,6))); }
public static String getCurrentDateTime(final String localeLang, final String localeCountry, final String timezone, final String dateFormat) throws Exception { final DateTimeFormatter formatter = getDateTimeFormatter(localeLang, localeCountry, timezone, dateFormat); final DateTime datetime = DateTime.now(); if (DateTimeUtils.isUnix(localeLang)) { Long unixSeconds = (long) Math.round(datetime.getMillis() / Constants.Miscellaneous.THOUSAND_MULTIPLIER); return unixSeconds.toString(); } return formatter.print(datetime); }
DateTimeService { public static String getCurrentDateTime(final String localeLang, final String localeCountry, final String timezone, final String dateFormat) throws Exception { final DateTimeFormatter formatter = getDateTimeFormatter(localeLang, localeCountry, timezone, dateFormat); final DateTime datetime = DateTime.now(); if (DateTimeUtils.isUnix(localeLang)) { Long unixSeconds = (long) Math.round(datetime.getMillis() / Constants.Miscellaneous.THOUSAND_MULTIPLIER); return unixSeconds.toString(); } return formatter.print(datetime); } }
DateTimeService { public static String getCurrentDateTime(final String localeLang, final String localeCountry, final String timezone, final String dateFormat) throws Exception { final DateTimeFormatter formatter = getDateTimeFormatter(localeLang, localeCountry, timezone, dateFormat); final DateTime datetime = DateTime.now(); if (DateTimeUtils.isUnix(localeLang)) { Long unixSeconds = (long) Math.round(datetime.getMillis() / Constants.Miscellaneous.THOUSAND_MULTIPLIER); return unixSeconds.toString(); } return formatter.print(datetime); }  }
DateTimeService { public static String getCurrentDateTime(final String localeLang, final String localeCountry, final String timezone, final String dateFormat) throws Exception { final DateTimeFormatter formatter = getDateTimeFormatter(localeLang, localeCountry, timezone, dateFormat); final DateTime datetime = DateTime.now(); if (DateTimeUtils.isUnix(localeLang)) { Long unixSeconds = (long) Math.round(datetime.getMillis() / Constants.Miscellaneous.THOUSAND_MULTIPLIER); return unixSeconds.toString(); } return formatter.print(datetime); }  static String getCurrentDateTime(final String localeLang, final String localeCountry, final String timezone, final String dateFormat); static String parseDate(final String date, final String dateFormat, final String dateLocaleLang,
                                   final String dateLocaleCountry, final String outFormat, final String outLocaleLang,
                                   final String outLocaleCountry); static String offsetTimeBy(final String date, final String offset, final String localeLang, final String localeCountry); }
DateTimeService { public static String getCurrentDateTime(final String localeLang, final String localeCountry, final String timezone, final String dateFormat) throws Exception { final DateTimeFormatter formatter = getDateTimeFormatter(localeLang, localeCountry, timezone, dateFormat); final DateTime datetime = DateTime.now(); if (DateTimeUtils.isUnix(localeLang)) { Long unixSeconds = (long) Math.round(datetime.getMillis() / Constants.Miscellaneous.THOUSAND_MULTIPLIER); return unixSeconds.toString(); } return formatter.print(datetime); }  static String getCurrentDateTime(final String localeLang, final String localeCountry, final String timezone, final String dateFormat); static String parseDate(final String date, final String dateFormat, final String dateLocaleLang,
                                   final String dateLocaleCountry, final String outFormat, final String outLocaleLang,
                                   final String outLocaleCountry); static String offsetTimeBy(final String date, final String offset, final String localeLang, final String localeCountry);  }