怎么样才能将字符串Tue May 23 00:00:00 CST 2006转换成一般的Date,或者转换成2006-05-23这样的字符串?
解决方案 »
- 快年初了,又是找工作的黄金季,来几个【面试题】
- 商业软件的Java界面开发,该选择什么技术和工具
- 完了,我欲哭无泪啊!!!
- static成员方法的调用问题
- 请问大家一个问题,现在有一个父类F,里面用ThreadLocal()对象记录了某个资源(比如Connection),然后有很多类extends这个F,其他的类通
- 关于类型转换的问题
- 如何修改Image对象,使其图形改变。
- 十万火急求救,关于WAS5
- 这个程序为什么编译通过,运行有错?
- 一个简单问题
- 问个简单的问题吧 关于javascript的<input type="submit" name="Submit" onclick="queryButtonClick()" value="提交"> 我怎样写queryB
- 高手解决下
SimpleDateFormat dataFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
String NowStr = dataFormat.format(now);
否则就采用SimpleDateFormat,用起来很爽哦
不明白sun为什么不也加个转换这样个是的API呢!
System.out.println(d);结果不对,应该是时区的关系。自己再查资料吧
if(data != null && data.length() == 28 && data.indexOf("CST") == 20){
String year = data.substring(24, 28);
String date = data.substring(8, 10);
String temp = data.substring(4,7);
if(temp.equals("Jan")){
data = year + "-" + "01" + "-" + date;
}
if(temp.equals("Feb")){
data = year + "-" + "02" + "-" + date;
}
if(temp.equals("Mar")){
data = year + "-" + "03" + "-" + date;
}
if(temp.equals("Apr")){
data = year + "-" + "04" + "-" + date;
}
if(temp.equals("May")){
data = year + "-" + "05" + "-" + date;
}
if(temp.equals("Jun")){
data = year + "-" + "06" + "-" + date;
}
if(temp.equals("Jul")){
data = year + "-" + "07" + "-" + date;
}
if(temp.equals("Aug")){
data = year + "-" + "08" + "-" + date;
}
if(temp.equals("Sep")){
data = year + "-" + "09" + "-" + date;
}
if(temp.equals("Oct")){
data = year + "-" + "10" + "-" + date;
}
if(temp.equals("Nov")){
data = year + "-" + "11" + "-" + date;
}
if(temp.equals("Dec")){
data = year + "-" + "12" + "-" + date;
}
}