2020年02月15日10:04
UWSCで西暦を和暦に変換するプログラムです。↓
参考
JapaneseCalendar クラス
UWSCで西暦を和暦に変換
カテゴリー │UWSC
UWSCで西暦を和暦に変換するプログラムです。↓
//西暦を和暦に変換.uws
GETTIME()
date = G_TIME_YY + "/" + G_TIME_MM + "/" + G_TIME_DD
PRINT WesternCalendarToJapaneseCalendar(date)
//西暦から和暦に変換する関数
FUNCTION WesternCalendarToJapaneseCalendar(date)
japanese_calendar = CreateOleObj("System.Globalization.JapaneseCalendar")
era_num = japanese_calendar.GetEra(date)
SELECT era_num
CASE 1
era = "明治"
CASE 2
era = "大正"
CASE 3
era = "昭和"
CASE 4
era = "平成"
CASE 5
era = "令和"
SELEND
year = japanese_calendar.GetYear(date)
month = japanese_calendar.GetMonth(date)
day = japanese_calendar.GetDayOfMonth(date)
RESULT = era + year + "年" + month + "月" + day + "日"
FEND
参考
JapaneseCalendar クラス