12345678910111213141516171819202122232425 |
- package com.chinacreator.videoalliance.order.util;
- import java.text.SimpleDateFormat;
- import java.util.Calendar;
- import java.util.Date;
- /**
- * Create by IntelliJ IDEA.
- * Author: EricJin
- * Date: 08/07/2018 15:28
- */
- public class DateUtils {
- public static String getDateFromFormat(String format) {
- SimpleDateFormat df = new SimpleDateFormat(format);
- Date date = new Date();
- return df.format(date);
- }
- public static String getDateFromFormat(String format, Calendar calendar) {
- Date time = calendar.getTime();
- SimpleDateFormat sdf = new SimpleDateFormat(format);
- return sdf.format(time);
- }
- }
|