---
sourceDocument: オーストラリア API リファレンス
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/api-reference

 Release :

    - australia

ft:locale :

    - ja-JP

ft:publication_title :

    - オーストラリア API リファレンス

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# DateTimeUtils - グローバル

# DateTimeUtils - グローバル {#ariaid-title1}

* リリースバージョン: Australia
* 
* 更新日 2026年03月12日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：2分

DateTimeUtils スクリプトインクルードは、日付/時刻関数のコレクションです。

このスクリプトインクルードは任意のサーバーサイドスクリプトで使用でき、GlideAjax から利用できます。

## DateTimeUtils:int8ToGlideDateTime(数値 int64) {#ariaid-title2}

Microsoft AD integer8 DateTime 形式を GlideDateTime 形式に変換します。
Integer8 は、Microsoft ファイルタイム形式とも呼ばれます。この方法は、有効期限などの AD ユーザーの日付フィールドをインポートするときによく使用されます。
{#r_DTU-int8ToGlideDateTime_N__table_rzj_nn1_4t__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| int64 | 番号 | 1601 年 1 月 1 日 (UTC) からの 100 ナノ秒間隔の数を表す 64 ビットの値。 |
[表 : 1. パラメーター]

{#r_DTU-int8ToGlideDateTime_N__table_rzj_nn1_4t} {#r_DTU-int8ToGlideDateTime_N__table_szj_nn1_4t__entry__2}

| タイプ | 説明 |
|-|-|
| GlideDateTime | Integer8 の日時に設定された GlideDateTime オブジェクト。 |
[表 : 2. 返される内容]

{#r_DTU-int8ToGlideDateTime_N__table_szj_nn1_4t}  

    //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(ミリ秒数) {#ariaid-title3}

ミリ秒を GlideDateTime オブジェクトに変換する
{#r_DTU-msToGlideDateTime_N__table_ocn_p41_4t__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| ミリ秒 | 番号 | ミリ秒数 |
[表 : 3. パラメーター]

{#r_DTU-msToGlideDateTime_N__table_ocn_p41_4t} {#r_DTU-msToGlideDateTime_N__table_pcn_p41_4t__entry__2}

| タイプ | 説明 |
|-|-|
| GlideDateTime | GlideDateTime オブジェクト |
[表 : 4. 返される内容]

{#r_DTU-msToGlideDateTime_N__table_pcn_p41_4t}  

    //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();


