GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Embed Notice

HTML Code

Corresponding Notice

  1. Embed this notice
    zunda (zundan@mastodon.zunda.ninja)'s status on Saturday, 02-Dec-2023 07:21:41 JSTzundazunda
    • かき@GNUsocialJP

    僕の使っているコマンドラインツールの #ひかえめなアドベントカレンダー2023 12月1日分はdateコマンドです。

    TZ環境変数(候補は/usr/share/zoneinfo以下)を設定して世界時計にしたり(夏時間に注意!!)、

    $ TZ=Australia/Sydney date; TZ=Japan date;TZ=America/Los_Angeles date; TZ=Pacific/Honolulu date
    Sat Dec 2 09:20:16 AM AEDT 2023
    Sat Dec 2 07:20:16 AM JST 2023
    Fri Dec 1 02:20:16 PM PST 2023
    Fri Dec 1 12:20:16 PM HST 2023

    タイムゾーンの変換をしたり(macOSで/bin/dateにあるBSD dateには-dオプションが無いのでbrew install coreutilsなどでGNU dateをインストールする必要があります)、

    $ TZ=UTC date -d '2024-01-01 00:00 JST'
    Sun Dec 31 03:00:00 PM UTC 2023

    ファイル名にタイムスタンプを含めたりできます。

    $ echo Hello, World! > hello-`date +%Y%m%d`.txt
    $ ls hello-*.txt
    hello-20231201.txt

    僕は24時間表記の方が便利なのでLC_TIMEをCに設定しています。

    $ LC_TIME= date; LC_TIME=C date
    Fri Dec 1 12:21:18 PM HST 2023
    Fri Dec 1 12:21:18 HST 2023

    べんり!!

    In conversationSaturday, 02-Dec-2023 07:21:41 JST from mastodon.zunda.ninjapermalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.