--- title: "Datetime Expressions" slug: "datetime-expressions" updated: 2023-10-31T15:24:06Z published: 2023-10-31T15:24:06Z canonical: "support.tulip.co/datetime-expressions" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.tulip.co/llms.txt > Use this file to discover all available pages before exploring further. # Datetime式の使用 *TulipでExpressions Editorを使ってdatetimeデータを変更・操作する方法をご紹介します。* datetimeデータを扱うとき、アプリケーションでそれを変更したいと思うかもしれません。式を使うことで、与えられた時間を足したり引いたり、datetimeを与えられた単位に丸めたり、データ型を変更するために型キャスト式を使うことができます。これらのシナリオと、式を使用してdatetimeデータを変更する方法について説明します。 注: これらの式の中には、式にタイムゾーンを含める必要があるものもあります。サポートしているタイムゾーンの一覧は、[このウェブサイトを](https://www.php.net/manual/en/timezones.php)参照ください。 --- **add_time(**) 指定した時間に、指定した継続時間単位を追加します。 ![Datetime Expressions - add_time ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Datetime%20Expressions%20-%20add_time%20ex.png) **subtract_time**() 指定された時間から指定された継続時間単位を引く ![Datetime Expressions - subtract_time ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Datetime%20Expressions%20-%20subtract_time%20ex.png) ![Datetime Expressions - add subtract_time ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Datetime%20Expressions%20-%20add%20subtract_time%20ex.gif) **rounddatetime(**) 指定した単位で日付を切り捨てます。 ![Datetime Expressions - rounddatetime ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Datetime%20Expressions%20-%20rounddatetime%20ex.png) 上記の式を使用すると、datetimeはこのように直近の日に丸められます: ![Datetime Expressions - rounddatetime ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Datetime%20Expressions%20-%20rounddatetime%20ex%20in%20app.png) ## 日時の型キャスト 以下の式は、既存のデータ型を異なるデータ型に型変換し、書式を変更して異なるコンテキストで使用できるようにします。 **datetimetotext(**) 指定した datetime データ型を text データ型に変更します。 ![datetimetotext expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/datetimetotext%20expression%20ex.png) ![datetimetotext expressions ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/datetimetotext%20expressions%20ex%20in%20app.png) **texttodatetime()**指定した text データ型を datetime データ型に変更する --- お探しのものは見つかりましたか? [community.tulip.coに](https://community.tulip.co/?utm_source=intercom&utm_medium=article-link&utm_campaign=all)質問を投稿したり、他の人が同じような質問に直面していないか確認することもできます!