Tweet
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); String time = sdf.format(new Date());Java has the specification of getting format automatically from the locale setting, so the following codes should work without any specified format:
DateFormat df = DateFormat.getDateTimeInstance(); String time = df.format(new Date());Other major programming languages also have libraries that can convert to formats corresponding to locales. Please refer to the locale issues for more details in each language chapter.
Go to Internationalization Programming Top