以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  是否有从身份证解析出属性(鸡,狗等)的函数?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=96482)

--  作者:czy66ds
--  发布时间:2017/2/21 22:44:00
--  是否有从身份证解析出属性(鸡,狗等)的函数?
如题
--  作者:有点蓝
--  发布时间:2017/2/21 22:55:00
--  
从身份证得出日期,然后再计算,参考:http://www.foxtable.com/bbs/dispbbs.asp?BoardID=5&ID=1980
--  作者:有点色
--  发布时间:2017/2/22 9:34:00
--  

 生肖是循环的,知道某年是某个生肖就可以推了,参考代码

 

Dim year As Integer = 2017
Dim sx() As String = { "鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪" }
Dim tmp As Integer = year - 2008
If year < 2008 Then
    msgbox(sx(tmp Mod 12 + 12))
Else
    msgbox(sx(tmp Mod 12))
End If