一个格式转换的问题。 请各位原谅我的无知吧。但我真的不知道。就是在android中怎样把一个日期给格式化。年月日时分秒的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 String.format("yyyy-MM-dd hh:mm:ss", System.currentTimeMillis());看看行不! SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");Date date = sdf.parse(“2012-9-13 10:00:00”);String create_time = formatter.format(date.getTime()); Calendar cal = Calendar.getInstance();String.format("%04d-%02d-%02d %02d:%02d:%02d", cal.get(Calendar.YEAR), cal.get(Calendar.MONTH)+1, cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND)); SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");String dateString=sdf.format(yourTime); 刚才真是够呛,不让编辑,还不让删除,重发下吧Calendar cal = Calendar.getInstance();String.format("%04d-%02d-%02d %02d:%02d:%02d", cal.get(Calendar.YEAR), cal.get(Calendar.MONTH)+1, cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND)); AlertDialog.Builder自定义按钮 这个日志文件那个朋友能给指点下 如何获取本地SD卡文件目录结构,并远程传送,在另一台有socket连接的手机设备上显示文件结构 如何取消监听 跪求android的wifi调试高手指点一下 BaseAdapter的作用 eclipse中启动avd为什么总要好几次 android如何更改图片与文字的相对位置 Android的BroadcastReceiver在开机触发时报错 Mediaplayer的资源释放 Android的消息推送,求助。。。 帮我解释下录音功能的源码
Date date = sdf.parse(“2012-9-13 10:00:00”);
String create_time = formatter.format(date.getTime());
Calendar cal = Calendar.getInstance();
String.format("%04d-%02d-%02d %02d:%02d:%02d", cal.get(Calendar.YEAR), cal.get(Calendar.MONTH)+1, cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND));
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString=sdf.format(yourTime);
String.format("%04d-%02d-%02d %02d:%02d:%02d", cal.get(Calendar.YEAR), cal.get(Calendar.MONTH)+1, cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND));