strftime is always showing am for times (even for "pm" time also) for every datetime entry in rails -
iam saving current date , time in database checkin time in db. using time.now. , when query database iam getting time in "am" time in "pm" also.
@curr_emp_attendace = current_employee.punch_in_outs.where("year(check_in) = ? , month(check_in) = ?",time.now.strftime("%y") ,time.now.strftime("%m") )
and in view iam displaying <%= attendace.check_in.strftime("%a %d, %h:%m %p")
when display iam getting "am" time (for times in "pm") also. might reason iam not understanding.
try this:
@curr_emp_attendace = current_employee.punch_in_outs.where(:check_in => time.now)
Comments
Post a Comment