Option Explicit
Function CanYear(nam As Long)
Dim Mg()
Mg = Array(“Canh”, “Tan”, “Nham”, “Quy”, “Giap”, “At”, “Binh”, “Dinh”, “Mau”, “Ky”)
CanYear = Mg(nam Mod 10)
End Function
Function ChiYear(nam As Long)
Dim Mg()
Mg = Array(“Than”, “Dau”, “Tuat”, “Hoi”, “Ti”, “Suu”, “Dan”, “Mao”, “Thin”, “Ty”, “Ngo”, “Mui”)
ChiYear = Mg(nam Mod 12)
End Function
Function Canday(ngay As Date)
Dim Mg()
Dim tam
tam = DateSerial(Year(ngay), Month(ngay), Day(ngay))
Mg = Array(“Nham”, “Quy”, “Giap”, “At”, “Binh”, “Dinh”, “Mau”, “Ky”, “Canh”, “Tan”)
Canday = Mg(tam Mod 10)
End Function
Function Chiday(ngay As Long)
Dim Mg()
Dim tam
tam = DateSerial(Year(ngay), Month(ngay), Day(ngay))
Mg = Array(“Than”, “Dau”, “Tuat”, “Hoi”, “Ti”, “Suu”, “Dan”, “Mao”, “Thin”, “Ty”, “Ngo”, “Mui”)
Chiday = Mg(tam Mod 12)
End Function