c92af476081000067b8e3bc30a32195027a672b5.svn-base 657 B

12345678910111213141516171819202122232425
  1. package com.chinacreator.videoalliance.order.util;
  2. import java.text.SimpleDateFormat;
  3. import java.util.Calendar;
  4. import java.util.Date;
  5. /**
  6. * Create by IntelliJ IDEA.
  7. * Author: EricJin
  8. * Date: 08/07/2018 15:28
  9. */
  10. public class DateUtils {
  11. public static String getDateFromFormat(String format) {
  12. SimpleDateFormat df = new SimpleDateFormat(format);
  13. Date date = new Date();
  14. return df.format(date);
  15. }
  16. public static String getDateFromFormat(String format, Calendar calendar) {
  17. Date time = calendar.getTime();
  18. SimpleDateFormat sdf = new SimpleDateFormat(format);
  19. return sdf.format(time);
  20. }
  21. }