admin 管理员组

文章数量: 1184232


2024年4月24日发(作者:excel offset函数)

日期格式大全.txt这是一个禁忌相继崩溃的时代,没人拦得着你,只有你自己拦着自己,

你的禁忌越多成就就越少。自卑有多种档次,最高档次的自卑表现为吹嘘自己干什么都是天

才。Java中日期格式转换

/**

* 字符串转换为

* 支持格式为 G 'at' hh:mm:ss z 如 '2002-1-1 AD at 22:10:59

PSD'

* yy/MM/dd HH:mm:ss 如 '2002/1/1 17:55:00'

* yy/MM/dd HH:mm:ss pm 如 '2002/1/1 17:55:00 pm'

* yy-MM-dd HH:mm:ss 如 '2002-1-1 17:55:00'

* yy-MM-dd HH:mm:ss am 如 '2002-1-1 17:55:00 am'

* @param time String 字符串

* @return Date 日期

*/

public static Date stringToDate(String time){

SimpleDateFormat formatter;

int tempPos=f("AD") ;

time=() ;

formatter = new SimpleDateFormat (" G 'at' hh:mm:ss z");

if(tempPos>-1){

time=ing(0,tempPos)+

"公元"+ing(tempPos+"AD".length());//china

formatter = new SimpleDateFormat (" G 'at' hh:mm:ss z");

}

tempPos=f("-");

if(tempPos>-1&&(f(" ")<0)){

formatter = new SimpleDateFormat ("yyyyMMddHHmmssZ");

}


本文标签: 自卑 转换 时代 档次 格式