SimpleDateFormat 星期几
SimpleDateFormat Day of Week
目前我是这样做的:
DateFormat dateInstance = new SimpleDateFormat("EEE"); --> e.g.: Mo.
DateFormat dateInstance2 = SimpleDateFormat.getDateInstance(); --> 09.11.2015
String s = dateInstance.format(date) + " " + dateInstance2.format(date);
但是 DateFormat dateInstance = new SimpleDateFormat("EEE");
被标记为我应该使用 SimpleDateFormat.get 的消息......
但我需要这样的输出 "Mon. 09.11.2015"。没有编译器的通知。谢谢你的帮助
将 @SuppressLint("SimpleDateFormat")
添加到您的方法或 class。例如:
@SuppressLint("SimpleDateFormat")
public MonthAdapter(Context context, String monthFormat) {
super(context, _months);
_simpleDateFormat = new SimpleDateFormat(monthFormat);
}
你可能需要这个?
DateFormat dateInstance = new SimpleDateFormat("EEE yyyy.MM.dd", Locale.ENGLISH);
String s = dateInstance.format(date);
目前我是这样做的:
DateFormat dateInstance = new SimpleDateFormat("EEE"); --> e.g.: Mo.
DateFormat dateInstance2 = SimpleDateFormat.getDateInstance(); --> 09.11.2015
String s = dateInstance.format(date) + " " + dateInstance2.format(date);
但是 DateFormat dateInstance = new SimpleDateFormat("EEE");
被标记为我应该使用 SimpleDateFormat.get 的消息......
但我需要这样的输出 "Mon. 09.11.2015"。没有编译器的通知。谢谢你的帮助
将 @SuppressLint("SimpleDateFormat")
添加到您的方法或 class。例如:
@SuppressLint("SimpleDateFormat")
public MonthAdapter(Context context, String monthFormat) {
super(context, _months);
_simpleDateFormat = new SimpleDateFormat(monthFormat);
}
你可能需要这个?
DateFormat dateInstance = new SimpleDateFormat("EEE yyyy.MM.dd", Locale.ENGLISH);
String s = dateInstance.format(date);