新手问题 怎样存储一个 年份 字段?

gechentuo · March 19, 2014 · Last by gechentuo replied at March 19, 2014 · 2099 hits

我的 model 中有一个字段 是 年份。date 类型,是年-月-日格式的,我只想要年份。date 类型在页面上默认显示的是三个 select,有没有办法只显示一个年份的 select

select_year(2014)

#1 楼 @fresh_fish 谢谢你了啊。 我还想问下,页面上用 select_year,那这个字段该用什么类型来存储呢?

#2 楼 @gechentuo 看你的需求吧,string 和 datetime 都可以吧

You need to Sign in before reply, if you don't have an account, please Sign up first.