---
schema_version: "1"
id: 18226d374f7aafff1a249a4af54dd5d0918e1c8cc5d26e42fce327bf240aa357
title: toTime
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.7/dw-coercions-functions-totime.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.7/dw-coercions-functions-totime
source_site: docs.mulesoft.com
content_type: documentation
content_hash: a73c503c0b1e834851d8fd99fee5b7d5f626d15368fe883d5f21f6bcaf24520f
description: MuleSoft Documentation Site
release: "2.7"
latest: false
---
# toTime

## [](#totime1)toTime(str: String, format: String | Null = null, locale: String | Null = null): Time

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

_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>Time</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>Time</code>​ 値に対して使用する書式設定。
           ​<code>null</code>​ 値は ​<code>Time</code>​ 値に対して無効です。
           このパラメーターでは、ISO-8601 に基づいた Java 文字パターンを受け入れます。​<code>10:15:30.000000</code>​ などの ​<code>Time</code>​ 値の形式は ​<code>HH:mm:ss.nxxx</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>

### [](#例)例

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

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

```DataWeave
%dw 2.0
import * from dw::util::Coercions
output application/dw
---
{
   a: toTime("23:57:59Z"),
   b: toTime("13:44:12.283-08:00","HH:mm:ss.nxxx")
}
```

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

```DataWeave
{
  a: |23:57:59Z|,
  b: |13:44:12.000000283-08:00| as Time {format: "HH:mm:ss.nxxx"}
}
```