# Order Printerで発行する納品書に、購入日と時間を日本時間で掲載したいです

**URL:** <https://community.shopify.com/t/order-printer/16970>\
**Category:** Shopify アプリ\
**Created:** [July 31, 2020, 2:49am UTC](https://community.shopify.com/t/order-printer/16970 "2020-07-31T02:49:39Z")\
**Posts on this page:** 6\
**Page:** 1

## AI-generated summary

Order Printerの納品書で、印刷日時ではなく購入日時を日本時間で表示したい、という相談。あわせて、納品書へメモ欄を印字できるかも質問されていました。

・回答では、テンプレート内の現在日時用の変数ではなく、注文作成日時を表すLiquid変数 `created_at` を使い、`date` フィルタで表示形式を指定する方法が提案されました。Ruby/Liquidの日時書式も案内されています。
・メモ欄は `{{ note }}` で表示でき、これは実際に反映できたと報告されています。

その後、ストア言語やタイムゾーン設定を日本語・日本にしても、日本時間表示や注文時間表示は解決しないとの追加報告がありました。設定変更だけでは不十分だったようです。

最終的には、`{{ created_at | date: "%Y/%m/%e/%X" }}` という記述で、日本時間で購入日と時刻を表示できたとして解決済みです。画像や添付はなく、中心はテンプレートのコード修正でした。

<div class="post-metadata">

**Author:** ![yuu](https://avatars.discourse-cdn.com/v4/letter/y/ce7236/32.png) [@yuu](https://community.shopify.com/u/yuu)\
**Post date:** [July 31, 2020, 2:49am UTC](https://community.shopify.com/t/order-printer/16970/1 "2020-07-31T02:49:39Z")

</div>

納品書の発行にOrder Printerアプリを使おうと思いますが、

プレビューすると、購入日ではなく、納品書の発行時刻が表示されます。さらに、日本時間ではありません。。

希望としては、購入日と時刻を、日本時間で掲載したいのですが、

方法をご存じの方はいらっしゃいますでしょうか？困っています。。

それから、納品書にメモを入力＆印刷できるようにもできれば最高です。

どうぞよろしくお願いいたします。

---

<div class="post-metadata">

**Author:** ![Jizo\_Inagaki](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/jizo_inagaki/32/149480_2.png) [@Jizo\_Inagaki](https://community.shopify.com/u/Jizo_Inagaki)\
**Post date:** [August 1, 2020, 10:01pm UTC](https://community.shopify.com/t/order-printer/16970/2 "2020-08-01T22:01:17Z")

</div>

■購入日時

お使いのテンプレートですでに実行されているかもしれませんが、以下のURLの内容ではどうでしょう？

[https://community.shopify.com/c/Payments-Shipping-Fulfillment/How-to-get-the-Order-Date-on-the-invoice-not-date-of-printing/td-p/393770](https://community.shopify.com/c/Payments-Shipping-Fulfillment/How-to-get-the-Order-Date-on-the-invoice-not-date-of-printing/td-p/393770)

> So you can replace the current date with {{ created\_at | date: “%m/%d/%y” }} to list the date as mm/dd/yy\> \> There is [more information here](http://utm.io/ubZwR) on how to change the format.

以下を見ますと Rubyの記述方法で良いようなので、時間の追加などは下記ページ内にある参考リンク([http://www.strfti.me/](http://www.strfti.me/))やその他Ruby関連の情報からご希望の形にできるのではと思います。

[https://shopify.dev/docs/themes/liquid/reference/filters/additional-filters#date](https://shopify.dev/docs/themes/liquid/reference/filters/additional-filters#date)

今現在テンプレートに {{ date }} か {{ created\_at }} を使っているのであれば、ご希望の形にならないかもしれません。

■日本時間

日本時間への変更に関しては、おそらくダッシュボード左サイドメニューの「設定\>ストアの言語」にある「ストアの言語」を日本語にすれば対応できると思います。  
当初は「一般設定」の「タイムゾーン」で変更されると思っていたのですが、キャッシュの影響なのか「ストアの言語」の設定で変わるように見えましたので、上記のように記載しています。

そのため、まずは「タイムゾーン」の変更を試された方が良いかもしれません。

■備考欄

```ruby
{{ note }}

```

上記を記述すれば表示されるはずです。

---

<div class="post-metadata">

**Author:** ![Jizo\_Inagaki](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/jizo_inagaki/32/149480_2.png) [@Jizo\_Inagaki](https://community.shopify.com/u/Jizo_Inagaki)\
**Post date:** [August 1, 2020, 10:20pm UTC](https://community.shopify.com/t/order-printer/16970/3 "2020-08-01T22:20:11Z")

</div>

※投稿内容がなぜかスパム判定されましたので、再度投稿します。

■購入日と時刻

お使いのテンプレートがすでに実行済なら役に立ちませんが、そうでないなら以下が該当するかもしれません。

[https://community.shopify.com/c/Payments-Shipping-Fulfillment/How-to-get-the-Order-Date-on-the-invoice-not-date-of-printing/td-p/393770](https://community.shopify.com/c/Payments-Shipping-Fulfillment/How-to-get-the-Order-Date-on-the-invoice-not-date-of-printing/td-p/393770)

> So you can replace the current date with {{ created\_at | date: “%m/%d/%y” }} to list the date as mm/dd/yy\> \> There is [more information here](http://utm.io/ubZwR) on how to change the format.

時間に関してはRubyの書き方で良いようなので、以下のURLや、そこに書かれた参考サイト、その他Ruby関連のサイトでご希望に形にできると思います。

[https://shopify.dev/docs/themes/liquid/reference/filters/additional-filters#date](https://shopify.dev/docs/themes/liquid/reference/filters/additional-filters#date)  
[http://www.strfti.me/](http://www.strfti.me/)

■日本時間

管理画面の「設定\>言語」で日本語を選べば日本時間になると思います。

当初は「設定\>一般設定」のタイムゾーンで変わると思っていたのですが、「言語」の方で切り替わるように見えました。

そのため、一応まずはタイムゾーンを試していただく方がよいかと思います。

■メモ

```ruby
{{ note }}

```

チェックアウト画面の注文商品下部にある蘭でしたら、上記を記載すればその内容が表示されるはずです。

---

<div class="post-metadata">

**Author:** ![Jizo\_Inagaki](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/jizo_inagaki/32/149480_2.png) [@Jizo\_Inagaki](https://community.shopify.com/u/Jizo_Inagaki)\
**Post date:** [August 1, 2020, 10:24pm UTC](https://community.shopify.com/t/order-printer/16970/4 "2020-08-01T22:24:54Z")

</div>

※投稿内容がなぜかスパム判定されますので、なるべくプレーンテキストで記述します。

■購入日と時刻

お使いのテンプレートがすでに実行済なら役に立ちませんが、そうでないなら以下が該当するかもしれません。

[https://community.shopify.com/c/Payments-Shipping-Fulfillment/How-to-get-the-Order-Date-on-the-invoice-not-date-of-printing/td-p/393770](https://community.shopify.com/c/Payments-Shipping-Fulfillment/How-to-get-the-Order-Date-on-the-invoice-not-date-of-printing/td-p/393770)

> So you can replace the current date with {{ created\_at | date: “%m/%d/%y” }} to list the date as mm/dd/yy
> 
> There is more information here on how to change the format.

時間に関してはRubyの書き方で良いようなので、以下のURLや、そこに書かれた参考サイト、その他Ruby関連のサイトでご希望に形にできると思います。

[https://shopify.dev/docs/themes/liquid/reference/filters/additional-filters#date](https://shopify.dev/docs/themes/liquid/reference/filters/additional-filters#date)  
[http://www.strfti.me/](http://www.strfti.me/)

■日本時間

管理画面の「設定\>言語」で日本語を選べば日本時間になると思います。

当初は「設定\>一般設定」のタイムゾーンで変わると思っていたのですが、「言語」の方で切り替わるように見えました。

そのため、一応まずはタイムゾーンを試していただく方がよいかもしれません。

■メモ

{{ note }}  
チェックアウト画面の注文商品下部にある蘭でしたら、上記を記載すればその内容が表示されるはずです。

---

<div class="post-metadata">

**Author:** ![yuu](https://avatars.discourse-cdn.com/v4/letter/y/ce7236/32.png) [@yuu](https://community.shopify.com/u/yuu)\
**Post date:** [August 2, 2020, 9:41am UTC](https://community.shopify.com/t/order-printer/16970/5 "2020-08-02T09:41:34Z")

</div>

こんばんは！

ご多用のところ、回答いただきありがとうございます。

NOTEはうまく入れることができました！

言語の設定は以前から日本語、タイムゾーンも日本になっていますが、日本時間では表示されませんのと、

やはり上記方法では、「注文時間」は表示されませんでした。

難しいですね！

---

<div class="post-metadata">

**Author:** ![yuu](https://avatars.discourse-cdn.com/v4/letter/y/ce7236/32.png) [@yuu](https://community.shopify.com/u/yuu)\
**Post date:** [August 2, 2020, 9:53am UTC](https://community.shopify.com/t/order-printer/16970/6 "2020-08-02T09:53:41Z")

</div>

たびたびの投稿、申し訳ありません！

こちらの描き方で、日本時間で表示することができました。

_{{ created\_at | date: “%Y/%m/%e/%X” }}_

_ありがとうございました！助かりました！！_
