按日期位数写,高兴用什么字体就用什么字体
Option Compare Database
Option Explicit
Public Function Mdate(Oldate) As String
On Error GoTo ErrA
Dim dat As Variant, datA, datAA, datAB, datAC, datAD, datBA, datBB, datBC, datCA, datCB, datCC As String
dat = CDate(Oldate)
datA = Format(dat, "yyyymmdd")
datAA = Mid("○一二三四五六七八九", Mid(datA, 1, 1) + 1, 1)
datAB = Mid("○一二三四五六七八九", Mid(datA, 2, 1) + 1, 1)
datAC = Mid("○一二三四五六七八九", Mid(datA, 3, 1) + 1, 1)
datAD = Mid("○一二三四五六七八九", Mid(datA, 4, 1) + 1, 1): Rem 年
datBA = Mid(datA, 5, 1)
If datBA = 0 Then
datBB = ""
ElseIf datBA = 1 Then
datBB = "十"
End If
datBC = Mid(" 一二三四五六七八九", Mid(datA, 6, 1) + 1, 1): Rem 月
datCA = Mid(datA, 7, 1)
If datCA = 0 Then
datCB = ""
ElseIf datCA = 1 Then
datCB = "十"
ElseIf datCA = 2 Then
datCB = "廿"
ElseIf datCA = 3 Then
datCB = "三十"
End If
datCC = Mid(" 一二三四五六七八九", Mid(datA, 8, 1) + 1, 1): Rem 日
Mdate = datAA & datAB & datAC & datAD & "年" & datBB & datBC & "月" & datCB & datCC & "日"
Mdate = Replace(Mdate, " ", "")
ErrA:
Exit Function
End Function
网页格式不同," 一二三四五六七八九",第一位数为空字符,传上来了就没有,重编辑一次
[此贴子已经被作者于2007-1-8 22:14:47编辑过]
|