i have birthday string field in format:
17/06/1989 how can convert format using hyphens:
1989-06-17
by using date parsing:
date.parse("17/06/1989").strftime("%y-%m-%d") or regex substitution:
"17/06/1989".gsub(/(..)\/(..)\/(....)/, '\3-\2-\1')
Comments
Post a Comment