> For the complete documentation index, see [llms.txt](https://docs-embed.anyflow.jp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-embed.anyflow.jp/solution-editor/actions/data-transform/datetime.md).

# 日付と時刻アクション

日付と時刻はAnyflowの標準アプリで、以下の処理を実行できます。

* 日付や時刻のフォーマットを変換する
* 指定した時間だけスリープする

## **日時形式を変換** <a href="#convert-datetime" id="convert-datetime"></a>

日付形式を変換することができるアクションです。

### 入力フィールド

<table><thead><tr><th width="166.92578125">フィールド名</th><th>説明</th></tr></thead><tbody><tr><td>日時</td><td>変換したい日時を入力します。</td></tr><tr><td>フォーマット</td><td>変換したい形式を選択します。<br>また、選択肢にないフォーマットに変換したい場合は直接入力できます。</td></tr></tbody></table>

{% hint style="success" %}

### ヒント

以下のフォーマットは一部を抜粋しています。[詳細はこちらのドキュメント](https://pendulum.eustace.io/docs/#tokens)を参照してください。
{% endhint %}

### フォーマット <a href="#format" id="format"></a>

<table><thead><tr><th width="119.80859375">対象</th><th width="119.703125">フォーマット</th><th>出力例</th></tr></thead><tbody><tr><td>年</td><td>YYYY</td><td>2000, 2001, 2002 ... 2012, 2013</td></tr><tr><td></td><td>YY</td><td>00, 01, 02 ... 12, 13</td></tr><tr><td></td><td>Y</td><td>2000, 2001, 2002 ... 2012, 2013</td></tr><tr><td>月</td><td>MMM</td><td>January, February, March ...</td></tr><tr><td></td><td>MM</td><td>01, 02, 03 ... 11, 12</td></tr><tr><td></td><td>M</td><td>1, 2, 3 ... 11, 12</td></tr><tr><td>通日</td><td>DDDD</td><td>001, 002, 003 ... 364, 365</td></tr><tr><td></td><td>DDD</td><td>1, 2, 3 ... 4, 5</td></tr><tr><td>日付</td><td>DD</td><td>01, 02, 03 ... 30, 31</td></tr><tr><td></td><td>D</td><td>1, 2, 3 ... 30, 31</td></tr><tr><td>曜日</td><td>dddd</td><td>Monday, Tuesday, Wednesday ...</td></tr><tr><td></td><td>ddd</td><td>Mon, Tue, Wed ...</td></tr><tr><td></td><td>dd</td><td>Mo, Tu, We ...</td></tr><tr><td></td><td>d</td><td>0, 1, 2 ... 6</td></tr><tr><td>時間</td><td>HH</td><td>00, 01, 02 ... 23, 24</td></tr><tr><td></td><td>H</td><td>0, 1, 2 ... 23, 24</td></tr><tr><td></td><td>hh</td><td>01, 02, 03 ... 11, 12</td></tr><tr><td></td><td>h</td><td>1, 2, 3 ... 11, 12</td></tr><tr><td>分</td><td>mm</td><td>00, 01, 02 ... 58, 59</td></tr><tr><td></td><td>m</td><td>0, 1, 2 ... 58, 59</td></tr><tr><td>秒</td><td>ss</td><td>00, 01, 02 ... 58, 59</td></tr><tr><td></td><td>s</td><td>0, 1, 2 ... 58, 59</td></tr><tr><td>少数秒</td><td>S</td><td>0 1 ... 8 9</td></tr><tr><td></td><td>SS</td><td>00, 01, 02 ... 98, 99</td></tr><tr><td>タイムゾーン</td><td>Z</td><td>-07:00, -06:00 ... +06:00, +07:00</td></tr><tr><td></td><td>ZZ</td><td>-0700, -0600 ... +0600, +0700</td></tr></tbody></table>

**例**

<figure><img src="https://files.readme.io/7978fc1-Screen_Shot_2023-05-23_at_4.53.06_PM.png" alt="&#x60;YYYY年MM月D日 HH時mm分ss秒&#x60; というフォーマットを入力" width="400"><figcaption><p><code>YYYY年MM月D日 HH時mm分ss秒</code> というフォーマットを入力</p></figcaption></figure>

<figure><img src="https://files.readme.io/3392ac6-Screen_Shot_2023-05-23_at_4.54.20_PM.png" alt="ワークフロー実行時間を任意のフォーマットに変換(UTC時間)" width="563"><figcaption><p>実行開始日時を任意のフォーマットに変換(UTC時間)</p></figcaption></figure>

{% hint style="success" %}

### Tips

タイムゾーンを変換するには、Formulaモードに切り替え、`in_timezone` 関数を利用します。

![](https://files.readme.io/897e8d2-Screen_Shot_2023-05-23_at_4.57.52_PM.png)
{% endhint %}

## **指定した時間処理をスリープ** <a href="#sleep" id="sleep"></a>

指定した時間だけ、ソリューションの処理を一時停止（スリープ）させるアクションです。

### **入力フィールド**

| フィールド名   | 説明                                                                                           |
| -------- | -------------------------------------------------------------------------------------------- |
| スリープする時間 | <p>処理を一時停止させる時間を設定します。<br>「選択」を選ぶと1分〜60分の選択肢の中から選択できます。<br>「直接入力」を選ぶと停止させる秒数を小数値で指定できます。</p> |

<figure><img src="https://files.readme.io/4c39a19-image.png" alt="「選択」を選んだ場合" width="563"><figcaption><p>「選択」を選んだ場合</p></figcaption></figure>

<figure><img src="https://files.readme.io/4455c28a32e2b22975c67faec4bbcee6ce8bd5b4c3180174faa404f13a7999bb-image.png" alt="「直接入力」を選んだ場合" width="563"><figcaption><p>「直接入力」を選んだ場合</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs-embed.anyflow.jp/solution-editor/actions/data-transform/datetime.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
