DateFormat[] () { Kernel32 kernel32 = Native.load("Kernel32", Kernel32.class); int bufferSize = 128, rv; char[] buffer = new char[bufferSize]; rv = kernel32.GetLocaleInfoEx(null, Kernel32.LOCALE_SSHORTDATE, buffer, bufferSize); if (rv < 2) throw new IllegalStateException("GetLocaleInfoEx: " + kernel32.GetLastError()); String shortDate = fixWindowsFormat(new String(buffer, 0, rv - 1)); rv = kernel32.GetLocaleInfoEx(null, Kernel32.LOCALE_SSHORTTIME, buffer, bufferSize); if (rv < 2) throw new IllegalStateException("GetLocaleInfoEx: " + kernel32.GetLastError()); String shortTime = fixWindowsFormat(new String(buffer, 0, rv - 1)); rv = kernel32.GetLocaleInfoEx(null, Kernel32.LOCALE_STIMEFORMAT, buffer, bufferSize); if (rv < 2) throw new IllegalStateException("GetLocaleInfoEx: " + kernel32.GetLastError()); String mediumTime = fixWindowsFormat(new String(buffer, 0, rv - 1)); Locale locale = Locale.getDefault(Locale.Category.FORMAT); return new DateFormat[]{ formatFromString(shortDate, locale), formatFromString(shortTime, locale), formatFromString(mediumTime, locale), formatFromString(shortDate + ' ' + shortTime, locale) }; }