DateTimeUtils - 전역
DateTimeUtils 클래스는 날짜 / 시간 함수의 모음입니다.
DateTimeUtils 클래스는 스크립트 포함 DateTimeUtils를 통해 제공됩니다.
DateTimeUtils 클래스는 모든 서버 측 스크립트에서 사용할 수 있으며 GlideAjax를 통해 사용할 수 있습니다.
DateTimeUtils - int8ToGlideDateTime(Number int64)
Microsoft AD integer8 DateTime 형식을 GlideDateTime 형식으로 변환합니다.
Integer8은 Microsoft Filetime 형식이라고도 합니다. 이 방법은 일반적으로 만료 날짜와 같은 AD 사용자의 날짜 필드를 가져올 때 사용됩니다.
| 이름 | 유형 | 설명 |
|---|---|---|
| Int64 | 번호 | 1601년 1월 1일(UTC) 이후의 100나노초 간격 수를 나타내는 64비트 값입니다. |
| 유형 | 설명 |
|---|---|
| GlideDateTime | Integer8 날짜 및 시간으로 설정된 GlideDateTime 객체입니다. |
//convert and set account expiration date from AD
//this is an example that could be used in an LDAP import transform map to import the LDAP account
//expires attribute to a customer created u_account_expires GlideDateTime field
var dtUtil = new DateTimeUtils();
target.u_account_expires = dtUtil.int8ToGlideDateTime(source.u_accountexpires);
DateTimeUtils - msToGlideDateTime(밀리초 수)
밀리초를 GlideDateTime 객체로 변환
| 이름 | 유형 | 설명 |
|---|---|---|
| 밀리초 | 번호 | 시간(밀리초) |
| 유형 | 설명 |
|---|---|
| GlideDateTime | GlideDateTime 객체 |
//example script to call the method from a client
Replace MILLISECONDSVALUE with your variable
var ga = new GlideAjax('DateTimeUtils');
ga.addParam('sysparm_name','msToGlideDateTime');
ga.addParam('sysparm_value', MILLISECONDSVALUE);
ga.getXMLWait();
var newGDT = ga.getAnswer();