/*** 把日期轉化為英文表示方式
* @param datatime 格式為 1323337201000毫秒數,或者日期字串格式為2011-12-08 17:40:01
* @return 格式為"thursday,december 08,2011 posted :17:40 bjt(0940 gmt)"
*/function parsetoenglishdata(datetime)else
};//字串格式為2011-12-08 17:40:01
var dateparse = function(datetimestr) )-(\d)-(\d) (\d):(\d):(\d)$/.exec(datetimestr);
if (mr) else
};var dayarray = ["mondey","tuesday","wednesday","thursday","friday","saturday","sunday"];
var montharray = ["january","february","marcy","april","may","june","july","august","september","october","november","december"];
var total ="";
var totaltime ;
if(typeof datetime == "number")else if(typeof datetime == 'string')
var d = new date(totaltime);
var utchours = d.getutchours(); //時
var utcminute = d.getutcminutes(); //分
//==bj
var bjyear = d.getfullyear();//年
var bjmonth = d.getmonth(); //月份
var bjdate = d.getdate(); //日
var bjday = d.getday(); //星期
var bjhours = d.gethours(); //時
var bjminute = d.getminutes(); //分
total+=dayarray[bjday]+","
total+=montharray[bjmonth]+" ,";
total+=bjyear+" posted :";
total+=tolong(bjhours)+":";
total+=tolong(bjminute)+" bjt(";
total+=tolong(utchours)+tolong(utcminute)+" gmt)";
//alert(total);
return total;
} //進行轉換
var s = parsetoenglishdata(1323337201000);
alert(s);
//字串
var s1 = parsetoenglishdata("2011-12-08 17:40:01");
alert(s1)
格式化日期
格式化日期 輸出形式取決於使用者計算機的文化設定。using system using system.globalization public class mainclass string date for int i 0 i format.length i d 07 11 2004 輸出 d su...
格式化日期
function dateformat datestr,types dim datestring if isdate datestr false then datestring end if select case types case 1 datestring year datestr month...
日期格式化
日期轉化一 為了達到不同的顯示效果有時,我們需要對時間進行轉化,預設格式為 2007 01 03 14 33 34 要轉化為其他格式,要用到datetime.tostring的方法 string,iformatprovider 如下所示 using system using system.globa...