我想在我邮件的签名中加入发邮件的日期和时间 但公司邮箱没有直接添加功能 我只能通过代码来实现 请问怎么实现
我希望我的邮件签名中出现:
xxxx年xx月xx日 xx时:xx分 这种格式 怎么搞
1、双击打开MyEclipse IDE开发软件,新建日期类DateUtils。
2、创建静态方法findDate,返回List<String>类型。
3、声明一个List<String> list集合,向List集合存储英文星期。
4、调用findDate静态方法,并打印List集合存储结果。
5、查看控制台打印的结果,看看结果组成结构。
怎么用JS?
追答
todayDate = new Date();
date = todayDate.getDate();
month= todayDate.getMonth() +1;
year= todayDate.getYear();
document.write("今天是")
document.write("")
if(navigator.appName == "Netscape")
{
document.write(1900+year);
document.write("年");
document.write(month);
document.write("月");
document.write(date);
document.write("日");
document.write("")
}
if(navigator.appVersion.indexOf("MSIE") != -1)
{
document.write(year);
document.write("年");
document.write(month);
document.write("月");
document.write(date);
document.write("日");
document.write("")
}
if (todayDate.getDay() == 5) document.write("星期五")
if (todayDate.getDay() == 6) document.write("星期六")
if (todayDate.getDay() == 0) document.write("星期日")
if (todayDate.getDay() == 1) document.write("星期一")
if (todayDate.getDay() == 2) document.write("星期二")
if (todayDate.getDay() == 3) document.write("星期三")
if (todayDate.getDay() == 4) document.write("星期四")
相信你能看懂伐