没有合适的资源?快使用搜索试试~ 我知道了~
domino xpages 开发NotesDateTime Date使用例子
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 103 浏览量
2022-02-27
16:30:44
上传
评论
收藏 55KB DOC 举报
温馨提示
试读
2页
domino xpages 开发NotesDateTime Date使用例子
资源推荐
资源详情
资源评论
在 javascript 有两个时间函数,NotesDateTime 和 Date
具体看帮助
NotesDateTime 转 Date
Note: This example is not best practice, but allows me to show you a function available in SSJS
var date1:NotesDateTime = session.CreateDateTime(“2013/01/17 06:00:00″);
var date2:Date = new Date(date1.getLocalTime());
The above-mentioned will fail because date1.getLocalTime() is an illegal Date value according to the
JavaScript Date Object. Having said that, there is an awesome NotesDateTime Method called.toJavaData() that
converts the value to a JavaScript Date Object:
var date1:NotesDateTime = session.CreateDateTime(“2013/01/17 06:00:00″);
var date2:Date = new Date(date1.toJavaDate());
1) 相关 1 公式函数
var date1=@Now();
var ymd=@Text(@Year(date1))+"-"+@Text(@Month(date1))+"-"+@Text(@Day(date1));
2) 2) NotesDateTime 具体看帮助
var doc:NotesDocument = varRowView.getDocument();
var d:NotesDateTime = doc.getItemValue("BidDueDate")[0];
//var dt:NotesDateTime = doc.getItemValueDateTimeArray("RecordedTime").elementAt(0);
var t:NotesDateTime = session.createDateTime("Today");
if (d.timeDifference(t) > 0 ) {
return "Overdue";
}else{
return "";
}
3) Data 具体看帮助
Date() Date(value:long) Date(value:string) Date(year:int, month:int)Date(year:int, month:int,
day:int) Date(year:int, month:int, day:int, hour:int) Date(year:int, month:int, day:int, hours:int,
minutes:int) Date(year:int, month:int, day:int, hours:int, minutes:int, seconds:int) Date(year:int,
month:int, day:int, hours:int, minutes:int, seconds:int, ms:int)
Parameters
Description
value - long
Numeric value of a date, that is, the number of milliseconds from 0 hours on January 1, 1970.
value - string
String representing the date in the format generated by toString (Date - JavaScript).
year
The year. Specify the entire year, for example, 2006 not 06.
month
The month where 0 is January and 11 is December.
day
The day of the month where 1 is the first day. Defaults to 1.
hours
The hour where 1 is 1:00 AM and 13 is 1:00 PM. Defaults to 0 (12:00 AM).
min
The minute where 1 is the first minute. Defaults to 0.
sec
The second where 1 is the first second. Defaults to 0.
资源评论
weijia3624
- 粉丝: 668
- 资源: 722
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功