---
schema_version: "1"
id: d6cb645b179cd6e1a35fe96afd7bd71a7f57642eaf842283d5ad4eb600f99eb0
title: toLocalDateTime
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.4/dw-coercions-functions-tolocaldatetime.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.4/dw-coercions-functions-tolocaldatetime
source_site: docs.mulesoft.com
content_type: documentation
content_hash: c8fcc37d62b3cbf121e5a26f872884c5cea255519360c1f9bed74474e282019c
description: MuleSoft Documentation Site
release: "2.4"
latest: false
---
# toLocalDateTime

## [](#tolocaldatetime1)toLocalDateTime(str: String, format: String | Null = null, locale: String | Null = null): LocalDateTime

`String`​ 値を ​`LocalDateTime`​ 値に変換して、形式とロケールを受け入れます。

_DataWeave バージョン 2.4.0 で導入されました。_​

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>str</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>LocalDateTime</code>​ 値に変換する ​<code>String</code>​ 値。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>format</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>LocalDateTime</code>​ 値に対して使用する書式設定。
             ​<code>null</code>​ 値は ​<code>LocalDateTime</code>​ 値に対して無効です。
             このパラメーターでは、ISO-8601 に基づいた Java 文字パターンを受け入れます。​<code>2011-12-03T10:15:30.000000</code>​ などの ​<code>LocalDateTime</code>​ 値の形式は ​<code>uuuu-MM-dd HH:mm:ss</code>​ となります。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>locale</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">使用する省略可能な ISO 3166 国コード (​<code>US</code>​、​<code>AR</code>​、​<code>ES</code>​ など)。​<code>null</code>​ または欠落値では JVM のデフォルトが使用されます。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、さまざまな入力での ​`toLocalDateTime`​ の動作を示します。 `application/dw`​ 形式の出力が生成されます。

#### [](#ソース)ソース

```DataWeave
%dw 2.0
import * from dw::util::Coercions
output application/dw
---
{
  a: toLocalDateTime("2015-10-01T23:57:59"),
  b: toLocalDateTime("2003-10-01 23:57:59","uuuu-MM-dd HH:mm:ss")
}
```

#### [](#出力)出力

```DataWeave
{
  a: |2015-10-01T23:57:59|,
  b: |2003-10-01T23:57:59| as LocalDateTime {format: "uuuu-MM-dd HH:mm:ss"}
}
```