Created
April 23, 2020 05:31
-
-
Save sogno12/9364c23cd911a2378d8a307154f03bf2 to your computer and use it in GitHub Desktop.
DateUtils
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kh.common; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
public class DateUtils { | |
public static String getNowDateString() { | |
Date now = new Date(); | |
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); | |
return sf.format(now); | |
} | |
public static String formatDate(Date date, String format) { | |
SimpleDateFormat sdf = new SimpleDateFormat(format); | |
return sdf.format(date); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment