'Get a localized date
'Parameter: Date as Long
'Parameter: Locale as string, like nl, uk, us etc.
'Example B4J:
'Global Private joInline As JavaObject = Me
'Log("Date Localized NL = " & joInline.RunMethod("getDateLocalized", Array(DateTime.Now, "nl")))
'Log("Date Localized US = " & joInline.RunMethod("getDateLocalized", Array(DateTime.Now, "us")))
#If JAVA
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;
public static String getDateLocalized(long mdate, String mlocale) {
int style = DateFormat.MEDIUM; //Other Dateformat styles: FULL, SHORT
DateFormat df=null;
df = DateFormat.getDateInstance(style, new Locale(mlocale));
return df.format(mdate);
}
#End If