1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Merge pull request #2924 from Laserlicht/datetime_android

Datetime android
This commit is contained in:
Ivan Savenko
2023-09-27 15:43:46 +03:00
committed by GitHub
2 changed files with 20 additions and 0 deletions

View File

@@ -17,6 +17,9 @@ import org.libsdl.app.SDLActivity;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.Date;
import java.util.Locale;
import java.text.SimpleDateFormat;
import eu.vcmi.vcmi.util.Log;
@@ -153,6 +156,14 @@ public class NativeMethods
}
}
@SuppressWarnings(Const.JNI_METHOD_SUPPRESS)
public static String getFormattedDateTime()
{
String currentDate = new SimpleDateFormat((new SimpleDateFormat()).toLocalizedPattern(), Locale.getDefault()).format(new Date());
return currentDate;
}
private static void internalProgressDisplay(final boolean show)
{
final Context ctx = SDL.getContext();