MySQL验证是否字符是日期串

No ready made function is provided 
To validate date 
This function work 
(you can take what ever size you want in varchar(1-1024) ) 

CREATE FUNCTION IsDate (sIn varchar(1024)) RETURNS INT 
BEGIN 
declare tp int; 

if (select length(date(sIn)) is null )then 
set tp = 0; 
else 
set tp = 1; 
end if; 
RETURN tp; 
END 
If you find any bug for this please post it here 
I will try to solve this

你可能感兴趣的:(MySQL验证是否字符是日期串)