Quantcast
Channel: ソフラボの技術ブログ
Viewing all 166 articles
Browse latest View live

winetricksでvlgothicがインストールできない対処方法

$
0
0

エラー内容

コマンドを実行するとダウンロードしたアーカイブチェックサムが不一致というエラーが出てインストールが完了しません。

$ winetricks --force fakejapanese_vlgothic

warning: taskset/cpuset not available on your platform!
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Using winetricks 20230212 - sha256sum: 524c3cd602ef222da3dc644a0a741edd8bca6dfb72ba3c63998a76b82f9e77b2 with wine-8.0.1(CrossOver FOSS 23.0.1) and WINEARCH=win64
Executing w_do_call fakejapanese_vlgothic
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Executing load_fakejapanese_vlgothic 
Executing w_do_call vlgothic
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Executing load_vlgothic 
------------------------------------------------------
warning: Checksum for /Users/owner/.cache/winetricks/vlgothic/VLGothic-20141206.tar.xz did not match, retrying download
------------------------------------------------------
Executing cd /Users/owner/.cache/winetricks/vlgothic
Downloading https://ja.osdn.net/projects/vlgothic/downloads/62375/VLGothic-20141206.tar.xz to /Users/owner/.cache/winetricks/vlgothic
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
1002020020--:--:----:--:----:--:--200000000--:--:----:--:----:--:--000000000--:--:--  0:00:01 --:--:--0
curl: (60) SSL certificate problem: certificate has expired
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
Executing cd /Users/owner/.cache/winetricks/vlgothic
Downloading https://web.archive.org/web/2000/https://ja.osdn.net/projects/vlgothic/downloads/62375/VLGothic-20141206.tar.xz to /Users/owner/.cache/winetricks/vlgothic
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  00000000--:--:----:--:----:--:--000000000--:--:--  0:00:02 --:--:--0100576201005762000166340  0:00:03  0:00:03 --:--:--  144k
Executing cd /Users/owner
------------------------------------------------------
SHA256 mismatch!

URL: https://web.archive.org/web/2000/https://ja.osdn.net/projects/vlgothic/downloads/62375/VLGothic-20141206.tar.xz
Downloaded: 580177c3a0464e97e0f35047ea8b8e91c7fd08fe996110b29a26a31e92b1c5f7
Expected: 982040db2f9cb73d7c6ab7d9d163f2ed46d1180f330c9ba2fae303649bf8102d

This is often the result of an updated package such as vcrun2019.
If you are willing to accept the risk, you can bypass this check.
Alternatively, you may use the --force option to ignore this check entirely.

Continue anyway?
------------------------------------------------------
Press Y or N, then Enter: N
------------------------------------------------------
warning: Operation cancelled, quitting.
------------------------------------------------------

原因

チェックサムが異なるというエラーだが、実際はコマンド経由でダウンロードしたアーカイブファイル「VLGothic-20141206.tar.xz」が壊れているため解凍できずにエラーが発生している状態でした。

対処方法

1.Googleで適当に「VLGothic-20141206.tar.xz」で検索します。
管理人は以下からダウンロードしました。
http://repository.timesys.com/buildsources/v/vlgothic/vlgothic-20141206/

2.ダウンロードしたファイルを以下の場所に置きます。

/Users/{ユーザー名}/.cache/winetricks/vlgothic

3.再度コマンドを実行時に、--forceをつけてチェックサムエラーを回避します。

$ winetricks --force fakejapanese_vlgothic

warning: taskset/cpuset not available on your platform!
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Using winetricks 20230212 - sha256sum: 524c3cd602ef222da3dc644a0a741edd8bca6dfb72ba3c63998a76b82f9e77b2 with wine-8.0.1(CrossOver FOSS 23.0.1) and WINEARCH=win64
Executing w_do_call fakejapanese_vlgothic
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Executing load_fakejapanese_vlgothic 
Executing w_do_call vlgothic
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Executing load_vlgothic 
Executing cd /Users/owner/.wine/dosdevices/c:/windows/temp
Executing tar -Jxf /Users/owner/.cache/winetricks/vlgothic/VLGothic-20141206.tar.xz
------------------------------------------------------
warning: Running /usr/local/bin/wineserver -w. This will hang until all wine processes inprefix=/Users/owner/.wine terminate------------------------------------------------------Executing wine C:\windows\syswow64\regedit.exe C:\windows\Temp\_register-font.reg007c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005007c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005007c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005007c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 0000000500cc:err:environ:init_peb starting L"C:\\windows\\syswow64\\regedit.exe" in experimental wow64 modeExecuting wine64 C:\windows\regedit.exe C:\windows\Temp\_register-font.regExecuting cp /Users/owner/.wine/dosdevices/c:/windows/temp/_register-font.reg /var/folders/bq/w7zvzth950d8cj7nv514vy7c0000gn/T//winetricks.0UcuiTpE/_reg_74f137bd_6391.regExecuting wine C:\windows\syswow64\regedit.exe C:\windows\Temp\_register-font.reg00fc:err:environ:init_peb starting L"C:\\windows\\syswow64\\regedit.exe" in experimental wow64 modeExecuting wine64 C:\windows\regedit.exe C:\windows\Temp\_register-font.regExecuting cp /Users/owner/.wine/dosdevices/c:/windows/temp/_register-font.reg /var/folders/bq/w7zvzth950d8cj7nv514vy7c0000gn/T//winetricks.0UcuiTpE/_reg_c62563e6_6391.regExecuting wine C:\windows\syswow64\regedit.exe C:\windows\Temp\_register-font.reg012c:err:environ:init_peb starting L"C:\\windows\\syswow64\\regedit.exe" in experimental wow64 modeExecuting wine64 C:\windows\regedit.exe C:\windows\Temp\_register-font.regExecuting cp /Users/owner/.wine/dosdevices/c:/windows/temp/_register-font.reg /var/folders/bq/w7zvzth950d8cj7nv514vy7c0000gn/T//winetricks.0UcuiTpE/_reg_6ae53c21_6391.regExecuting wine C:\windows\syswow64\regedit.exe C:\windows\Temp\_register-font.reg015c:err:environ:init_peb starting L"C:\\windows\\syswow64\\regedit.exe" in experimental wow64 modeExecuting wine64 C:\windows\regedit.exe C:\windows\Temp\_register-font.regExecuting cp /Users/owner/.wine/dosdevices/c:/windows/temp/_register-font.reg /var/folders/bq/w7zvzth950d8cj7nv514vy7c0000gn/T//winetricks.0UcuiTpE/_reg_adcd8fcc_6391.regExecuting wine C:\windows\syswow64\regedit.exe C:\windows\Temp\_register-font-replacements.reg018c:err:environ:init_peb starting L"C:\\windows\\syswow64\\regedit.exe" in experimental wow64 modeExecuting wine64 C:\windows\regedit.exe C:\windows\Temp\_register-font-replacements.regExecuting cp /Users/owner/.wine/dosdevices/c:/windows/temp/_register-font-replacements.reg /var/folders/bq/w7zvzth950d8cj7nv514vy7c0000gn/T//winetricks.0UcuiTpE/_reg_86ccd31f_6391.regExecuting wine C:\windows\syswow64\regedit.exe C:\windows\Temp\_register-font-replacements.reg01bc:err:environ:init_peb starting L"C:\\windows\\syswow64\\regedit.exe" in experimental wow64 modeExecuting wine64 C:\windows\regedit.exe C:\windows\Temp\_register-font-replacements.regExecuting cp /Users/owner/.wine/dosdevices/c:/windows/temp/_register-font-replacements.reg /var/folders/bq/w7zvzth950d8cj7nv514vy7c0000gn/T//winetricks.0UcuiTpE/_reg_ba37f77c_6391.regExecuting wine C:\windows\syswow64\regedit.exe C:\windows\Temp\_register-font-replacements.reg01ec:err:environ:init_peb starting L"C:\\windows\\syswow64\\regedit.exe" in experimental wow64 modeExecuting wine64 C:\windows\regedit.exe C:\windows\Temp\_register-font-replacements.regExecuting cp /Users/owner/.wine/dosdevices/c:/windows/temp/_register-font-replacements.reg /var/folders/bq/w7zvzth950d8cj7nv514vy7c0000gn/T//winetricks.0UcuiTpE/_reg_76961d0e_6391.reg

4.以上でインストール完了です。


XSERVERでCodeIgniter4を動かすための.htaccessの設定方法

$
0
0

XSERVERでCodeIgniter4を動かそうとすると、どうもmod_rewriteが認識されていないようだったので、どこで設定するのか少しハマりました。
今後もハマらないようにメモとして記事に残しておきます。

XSERVERの仕様

XSERVERで使われているWebサーバーはNGINXですが、なぜかApache.htaccessが動作する謎仕様です。

ドメインごとにホームディレクトリが作られるので、その中の「public_html」配下がWebサイトとして動作するディレクトリになります。

XSERVERでの.htaccessの設定場所

上記仕様の通り、.htaccessは「public_html」配下に置かれたものが認識されます。
CodeIgniterにもpublicディレクトリ配下に.htaccessがありますが、こちらはなぜか認識しないので編集しても動作が変わらない点に注意してください。

FTPやファイルマネージャーから直接.htaccessを編集しても良いですが、サーバーパネルにある「.htaccess編集」から編集すると簡単に操作できます。
www.xserver.ne.jp

CodeIgniter用の.htaccess内容

以下の内容で追記してください。間違っても既存の設定を削除しないように気をつけましょう。
CodeIgniter3、4で動作確認済みです。

# mod_rewrite有効化
RewriteEngine On

# https強制
RewriteCond %{HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}[R=301,L]# index.phpの置換
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1[L]

Gitの履歴内のユーザー名とメールアドレスを変更する方法

$
0
0

Gitでソース管理をしていますが、GitHub以外のリポジトリでもGitを使っている場合、ユーザー情報が異なる場合があります。
いろんな開発をしてると、流れでそのままコミットしてしまうので、意図しないユーザー情報でコミットしてしまうことがあります。
そんなときのユーザー情報の変更のやり方をまとめました。

古いやり方(filter-branch)

やり方を調べて、以下のコマンドを実行すると、警告文が表示されました。

git filter-branch --commit-filter'  if [ "$GIT_COMMITTER_EMAIL" = "xxx@users.noreply.github.com" ];    then        GIT_COMMITTER_EMAIL="xxx@gmail.com";        GIT_AUTHOR_EMAIL="xxx@gmail.com";        git commit-tree "$@";    else        git commit-tree "$@";    fi'  HEAD

WARNING: git-filter-branch has a glut of gotchas generating mangled history
         rewrites.  Hit Ctrl-C before proceeding to abort, then use an
         alternative filtering tool such as 'git filter-repo'(https://github.com/newren/git-filter-repo/) instead.  See the
         filter-branch manual page for more details; to squelch this warning,
         set FILTER_BRANCH_SQUELCH_WARNING=1.

filter-branchは壊れた履歴を生成する可能性があるため、filter-repoを使ってくれとのこと。

filter-repo のインストール

私の環境は、Macなのでbrewでインストールしました。

brew install git-filter-repo

新しいやり方(filter-repo)

新しいやり方は、filter-branchとは異なり少し事前準備が必要です。

1.名前と変更前後のメールアドレスを記載したファイルを作成する
ファイル名は何でも良いです。
中身は以下の形式で作成して下さい。

名前 <新しいメールアドレス> <古いアドレス(変更したいもの)>

例1:名前にブランクを含まない
yamada <xxx@gmail.com> <xxx@users.noreply.github.com>
例2:名前にブランクを含む(名前を""で括る)
"yamada taro" <xxx@gmail.com> <xxx@users.noreply.github.com>

2.filter-repoを実行します

git filter-repo -f--mailmap email.txt

3.ログで変更されているか確認する

4.pushする

FullCalendar.js v6の使い方まとめ

$
0
0

Googleカレンダーのようなカレンダーを自前で実装できるFullCalendar.jsの使い方を実際に使った機能だけまとめました。

使用バージョン

FullCalendar.js v6.1.11
fullcalendar.io

設定項目(全体)

<divid="calendar"></div>
const $calendar =document.getElementById('calendar');const calendar =newFullCalendar.calendar($calendar,{// ライセンスキーschedulerLicenseKey:'購入した場合にライセンスキーをここに書く',// 日本語設定locale:'ja',// 編集可editable:true,// ドロップ可droppable:true,// ヘッダーカスタムボタンcustomButtons:{// 作成ボタンcreateButton:{text:'予定・タスクの作成',click:function(){}}},// 最大表示イベント数(最大値を超えた部分は「+more」で表示)eventMaxStack:5,// 日表示時の最大表示イベント数(最大値を超えた部分は「+more」で表示)dayMaxEvents:5,// イベント表示順eventOrder:'type, id',// イベントevents:{url:`/api/schedule/`,method:'POST',extraParams:()=>{}failure:(error)=>{console.log(error);}},// イベントの時間フォーマットeventTimeFormat:{hour:'numeric',minute:'2-digit',meridiem:false},// イベントドロップ制御eventAllow:(info, event)=>{},// イベントドロップeventDrop:(info)=>{},// イベントリサイズeventResize:(info)=>{},// イベント内容eventDidMount:(info)=>{},// イベントクリックeventClick:(info)=>{},// カレンダー内日付・時間枠クリックdateClick:(info)=>{},// +moreリンクmoreLinkContent:(e)=>{},// +moreリンク描画後moreLinkDidMount:(e)=>{},// 初期カレンダータイプinitialView:'dayGridMonth',// ビューごとの設定views:{dayGridMonth:{dayMaxEventRows:5}},// カレンダー表示領域の高さcontentHeight:815,// 時間帯までのスクロール位置scrollTime:'06:00:00',// 週始まりfirstDay:1,// 月曜開始// 日コンテンツdayCellContent:function(e){return e.dayNumberText.replace("日","");},// ヘッダーボタンheaderToolbar:{left:'createButton',center:'prev title next',right:'timeGridWeek,timeGridDay,dayGridMonth'},// ヘッダーボタンテキストbuttonText:{week:'週',day:'日',month:'月'},// 終日テキストallDayText:'',// スロットコンテンツslotLabelContent:function(arg){return arg.date.getHours();},// 日ヘッダー描画後dayHeaderDidMount:(e)=>{},// 日付設定後datesSet:(dateInfo)=>{},});

設定項目詳細

個別に公式リンクを貼っていますが、バージョンアップされて消えた項目はページがなくなるのでご注意ください。
また、マイナーバージョンアップでも大幅に変更される項目もあります。

schedulerLicenseKey

購入したライセンスキーを設定します。
これを設定するとカレンダー下部の未ライセンス時の表示が消えます。

schedulerLicenseKey - Docs | FullCalendar

locale

ロケールごとの設定を適用します。
以下の部分がロケール対応されます。

  • ヘッダーツールバー内のボタン
  • 月、曜日
  • 日付フォーマット
  • 週番号の計算
  • 初日

locale - Docs | FullCalendar

editable(default: false)

カレンダー上でイベントを変更できるか設定します。
変更可能はtrue、変更不可はfalseです。

editable - Docs | FullCalendar

droppable(default: false)

外部のドラッグ可能な要素または他のカレンダーのイベントをカレンダーにドロップできるか設定します。

droppable - Docs | FullCalendar

customButtons

ヘッダーまたはフッターツールバー内に表示させる任意にカスタムボタンを定義します。

設定可能なプロパティ

  • text: ボタン内のテキスト
  • hint: ヒント
  • click: クリック時の処理
  • icon: アイコン
  • bootstrapFontAwesome: Bootstrapテーマが有効なときのアイコン

customButtons - Docs | FullCalendar

eventMaxStack(default: null)

timeLineView:上から下に積み重ねられるイベントの最大数
timeGridView:左から右に積み重ねられるイベントの最大数
最大数を超える部分は、「+more」等で表示され、押下でポップアップ表示されます。

eventMaxStack - Docs | FullCalendar

dayMaxEvents

dayGridView:上から下に積み重ねられるイベントの最大数
最大数を超える部分は、「+more」等で表示され、押下でポップアップ表示されます。

dayMaxEvents - Docs | FullCalendar

eventOrder(default: 'start,-duration,allDay,title')

同日内でのイベントの並び順を設定します。
イベント内のプロパティ名を指定します。
指定プロパティ名の先頭に「-」をつけると降順となります。

eventOrder - Docs | FullCalendar

events(as a json feed)

カレンダーに設定するイベントを定義します。
イベント設定は、主に固定値・APIから取得の2種類になるかと思います。
基本的には、APIから取得すると思うので以下の定義でイベントを取得します。

events:{url:`{APIのURL}`,
  method:'{GET、POST等}',
  extraParams:()=>{// APIに対してパラメータがある場合は、key: valueの形式で書く}failure:(error)=>{console.log(error);}}

events (as a json feed) - Docs | FullCalendar

eventTimeFormat

イベントの時間フォーマットを設定します。

以下は、「7:00、10:00」のような形式の設定方法です。

eventTimeFormat:{hour:'numeric',
  minute:'2-digit',
  meridiem:false},

eventTimeFormat - Docs | FullCalendar

eventAllow(eventDropInfo, event)

イベントのドロップ先を制御します。
第1引数:ドロップ先情報
第2引数:イベント情報
戻り値:ドロップ可能はtrue、ドロップ不可はfalse

eventAllow - Docs | FullCalendar

eventDrop(eventDropInfo)

イベントのドロップ後の処理を行います。
第1引数:イベントドロップ情報
戻り値:なし

eventDrop - Docs | FullCalendar

eventResize(eventResizeInfo)

イベントのサイズ変更の処理を行います。
第1引数:イベントリサイズ情報
戻り値:なし

eventResize - Docs | FullCalendar

eventDidMount(info)

要素がDOMに追加された直後に呼び出されます。イベントデータが変更された場合、これは再度呼び出されません。
この処理でDOM追加後の要素の表示変更等を行います。
第1引数:パラメーター(event、el等を含む)
戻り値:なし

Event Render Hooks - Docs | FullCalendar

eventClick(eventClickInfo)

イベントクリック時の処理を行います。
第1引数:イベントクリック情報
戻り値:なし

eventClick - Docs | FullCalendar

dateClick(dateClickInfo)

カレンダー内の日付・時間枠クリック時の処理を行います。
第1引数:日付クリック情報
戻り値:なし

dateClick - Docs | FullCalendar

moreLinkContent

「+more」の内容を設定します。
ロケール設定で日本語化されないので、別途日本語対応が必要です。

More-Link Render Hooks - Docs | FullCalendar

moreLinkDidMount

「+more」のDOM追加後に処理を行います。
「+more」要素に対してなにかしたい場合は、ここに処理を書きます。

More-Link Render Hooks - Docs | FullCalendar

initialView

初期表示時のビューを設定します。
設定値例

  • dayGridMonth
  • dayGridWeek
  • timeGridDay
  • listWeek

initialView - Docs | FullCalendar

views

ビューごとの設定を行います。

Custom Views via Settings - Docs | FullCalendar

contentHeight

カレンダーの表示領域の高さを設定します

contentHeight - Docs | FullCalendar

scrollTime

指定の時間までスクロールします。
時間軸があるビューのみ有効です。

scrollTime - Docs | FullCalendar

firstDay

週の始まりを設定します。
デフォルトは日曜(0)。
月曜(1)... 土曜(6)

firstDay - Docs | FullCalendar

dayCellContent(cell)

日セル(

)内の内容を処理します。
第1引数:日セル情報
// 例:「10日」→「10」にする
cell.dayNumberText.replace("日","");

Day-Cell Render Hooks - Docs | FullCalendar

headerToolbar

ヘッダーツールバーを設定します。
位置

  • start:左
  • center:中央
  • end:右

コンテンツ

  • title:現在の月/週/日
  • prev:日・月・年を戻るボタン
  • next:日・月・年を進むボタン
  • prevYear:前年ボタン
  • nextYear:次年ボタン
  • today:本日ボタン
  • ビュー名(dayGridMonth等)

headerToolbar - Docs | FullCalendar

buttonText

ボタンのテキストを設定します。

  • today:本日
  • month:月
  • week:週
  • day:日
  • list:リスト

|

buttonText - Docs | FullCalendar

allDayText

日・週カレンダー表示時に左の時間軸上部にある終日予定のラベルを設定します。
公式ドキュメントではv4までとありますが、v6でも使えます。
デフォルトは「all-day」が表示されるので、不要な場合は「''」を設定すると空にできます。

allDayText - Docs v4 | FullCalendar

slotLabelContent(arg)

時間軸の内容を設定します。
第1引数:スロットセル情報

Slot Render Hooks - Docs | FullCalendar

dayHeaderDidMount

日・週カレンダー表示時の日ヘッダーのDOM描画後の処理を行います。
使用例として、休日は背景色をピンクにするなどです。

Day-Header Render Hooks - Docs | FullCalendar

datesSet(dateInfo)

カレンダーの日付範囲が最初に設定または何らかの方法で変更され、DOM が更新された後に呼び出されます。
使用例として、カレンダーの日付が変わったときにスクロール位置を調整するなどです。
第1引数:日付情報

datesSet - Docs | FullCalendar

VMWare Fusionを直接ダウンロードする

$
0
0

VMWare Fusionが個人利用限定で無償利用できるようになりました。

提供会社が変更されてしまい、ダウンロードするにはアカウントが必要で、かなりわかりにくく面倒くさい形になってしまいました。

調べてみるとアカウント登録しなくても簡単にアプリをダウンロードする方法があったので紹介します。

ダウンロード方法

1.ターミナルを開く

2.以下のコマンドを実行する

# 最新バージョン
bash <(curl -sSL https://gist.github.com/jetfir3/6b28fd279bbcadbae70980bd711a844f/raw/download_fusion.sh)# バージョン指定
bash <(curl -sSL https://gist.github.com/jetfir3/6b28fd279bbcadbae70980bd711a844f/raw/download_fusion.sh)-v13.5.2

3.ダウンロードされたファイルをアプリケーションフォルダに移動する

Java Date Time API のフォーマットまとめ

$
0
0

JavaのDate Time APIのフォーマットを簡単にまとめてみました。
実行時ににエラーが発生するものは除外しています。

// 2024-09-19
LocalDate.now().format(DateTimeFormatter.ISO_DATE);
// 20240919
LocalDate.now().format(DateTimeFormatter.BASIC_ISO_DATE);
// 2024-09-19
LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE);
// 2024-263
LocalDate.now().format(DateTimeFormatter.ISO_ORDINAL_DATE);
// 2024-W38-4
LocalDate.now().format(DateTimeFormatter.ISO_WEEK_DATE);

// 11:07:50.769682
LocalTime.now().format(DateTimeFormatter.ISO_LOCAL_TIME);
// 11:07:50.769805
LocalTime.now().format(DateTimeFormatter.ISO_TIME);

// 2024-09-19
LocalDateTime.now().format(DateTimeFormatter.ISO_DATE);
// 20240919
LocalDateTime.now().format(DateTimeFormatter.BASIC_ISO_DATE);
// 2024-09-19T11:14:58.457402
LocalDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME);
// 2024-09-19
LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE);
// 2024-09-19T11:14:58.457541
LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
// 11:14:58.457636
LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_TIME);
// 2024-263
LocalDateTime.now().format(DateTimeFormatter.ISO_ORDINAL_DATE);
// 11:14:58.457764
LocalDateTime.now().format(DateTimeFormatter.ISO_TIME);
// 2024-W38-4
LocalDateTime.now().format(DateTimeFormatter.ISO_WEEK_DATE);

// 2024年9月19日木曜日
LocalDate.now().format(DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL));
// 2024年9月19日
LocalDate.now().format(DateTimeFormatter.ofLocalizedDate(FormatStyle.LONG));
// 2024/09/19
LocalDate.now().format(DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM));
// 2024/09/19
LocalDate.now().format(DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT));

// 2024/09/19 6:06:06, 2024/09/19 14:19:49
LocalDateTime.now().format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM));
// 2024/09/19 6:06, 2024/09/19 14:19
LocalDateTime.now().format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT));

// 6:06:06, 14:23:30
LocalTime.now().format(DateTimeFormatter.ofLocalizedTime(FormatStyle.MEDIUM));
// 6:06, 14:23
LocalTime.now().format(DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT))
<||
Viewing all 166 articles
Browse latest View live