Acceder Registrarme

Manejo de fechas en Ruby on Rails


Por: Kevin Arnold Arias Figueroa Publicado el: 2017-06-30 02:46:07
fecha.strftime(“%H”)  => “22” # Gives Hour of the time in 24 hour clock format
fecha.strftime(“%I”)  => “10” # Gives Hour of the time in 12 hour clock format
fecha.strftime(“%M”)  => “49” # Gives Minutes of the time
fecha.strftime(“%S”)  => “27” # Gives Seconds of the time
fecha.strftime(“%Y”)  => “2013” # Gives Year of the time
fecha.strftime(“%m”)  => “09” # Gives month of the time
fecha.strftime(“%d”)  => “12” # Gives day of month of the time
fecha.strftime(“%w”)  => “4”  # Gives day of week of the time
fecha.strftime(“%a”)  => “Thu”  # Gives name of week day in short form of the
fecha.strftime(“%A”)  => “Thursday” # Gives week day in full form of the time
fecha.strftime(“%b”)  => “Sep”  # Gives month in short form of the time
fecha.strftime(“%B”)  => “September”  # Gives month in full form of the time
fecha.strftime(“%y”)  => “13” # Gives year without century of the time
fecha.strftime(“%Y”)  => “2013” # Gives year without century  of the time
fecha.strftime(“%Z”)  => “IST”  # Gives Time Zone of the time
fecha.strftime(“%p”)  => “PM” # Gives AM / PM of the time