VB :: Lecture & TIPs

[VB.NET] KoreanLunisolarCalendar 클래스를 이용해 음양력 변환하기

.NET 에서는 System.Globalization.KoreanLunisonarCalendar 라는 음양력 날짜 클래스를 제공합니다.

다음 코드를 참고하시면 어떻게 하면 음양력으로 변환가능한지 쉽게 이해하실 수 있습니다.

Sub DateConversion()
	Dim LunarCalendar As New System.Globalization.KoreanLunisolarCalendar

	'### 오늘 날짜를 음력으로 변환합니다.
	MessageBox.Show(LunarCalendar.GetYear(Now) & "-" & LunarCalendar.GetMonth(Now) & "-" & LunarCalendar.GetDayOfMonth(Now))

	'### 음력 2020 년 02 월 14 일을 양력 날짜로 변환합니다. 
	MessageBox.Show(LunarCalendar.ToDateTime(2020, 2, 14, 0, 0, 0, 0))
End Sub

고맙습니다.

Leave a Reply

Discover more from Dream big, Achieve more.

Subscribe now to keep reading and get access to the full archive.

Continue reading