Convert String to date of specific timezone
问题 I need to convert a string to date in a specific timezone. Eg. from = "June 13, 2015" Date.strptime(from,"%b %d, %Y") #=> Sat, 13 Jun 2015 Date.strptime(from.strip,"%b %d, %Y").in_time_zone("America/Chicago") #=> Sat, 13 Jun 2015 00:00:00 CDT -05:00 which is ActiveSupport::TimeWithZone format Date.strptime(from,"%b %d, %Y").in_time_zone("America/Chicago").to_date #=>Sat, 13 Jun 2015 which is in UTC Date class I need the final date in America/Chicago timezone. How can I achieve that? I need to