在sql 设置date类型字段的格式

        DATE_FORMAT(NOW(),'%b %d %Y %h:%i %p')
        DATE_FORMAT(NOW(),'%m-%d-%Y')
        DATE_FORMAT(NOW(),'%d %b %y')
        DATE_FORMAT(NOW(),'%d %b %Y %T:%f')
对应格式:
        Dec 29 2008 11:45 PM
        12-29-2008
        29 Dec 08
        29 Dec 2008 16:25:46.635

sql实例:

SELECT id,fund_full_name,DATE_FORMAT(statistic_date,'%Y-%m-%d') as statistic_date,nav,sanav,swanav,user_id,DATE_FORMAT(create_time,'%Y-%m-%d') as create_time FROM fund_nav

 

 


    =  DATE_FORMAT(#{beginTime}, '%Y-%m-%d')   ]]>


    

你可能感兴趣的:(java,类)