📄 datetostring.prg
字号:
*——DateToString函数
* 将日期型数据转换为字符串
FUNCTION DateToString(dDate)
*——默认返回空字符串
sDate = ""
*——如果参数非空而且为日期型
IF .NOT. EMPTY(dDate) .AND. VARTYPE(dDate) = "D"
*——分别获取其年、月、日字段
nYear = YEAR(dDate)
nMonth = MONTH(dDate)
nDay = DAY(dDate)
*——组合数据
sDate = ALLTRIM(STR(nYear))+"/"+ALLTRIM(STR(nMonth))+"/"+ALLTRIM(STR(nDay))
sDate = "{^"+sDate +"}"
ENDIF
*——返回值
RETURN sDate
ENDFUNC
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -