Created
January 16, 2020 21:39
-
-
Save parzibyte/c61d2ed915a40bb07791abadb32e43f8 to your computer and use it in GitHub Desktop.
This file contains 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
@SuppressLint("SimpleDateFormat") | |
public static String obtenerFechaConFormato(String formato, String zonaHoraria) { | |
Calendar calendar = Calendar.getInstance(); | |
Date date = calendar.getTime(); | |
SimpleDateFormat sdf; | |
sdf = new SimpleDateFormat(formato); | |
sdf.setTimeZone(TimeZone.getTimeZone(zonaHoraria)); | |
return sdf.format(date); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment