Ruby date conversion -


I have to do Fri 26 Jun 23:05:00 -0400 200 9 Change to Eastern (US) Time How can this be done with Ruby

Thanks

  Tzinfo 'input_time = time Paras ('Venus 26 26:05:00 -0400 200') input_time.utc "input_time = # {input_time}" est_tz = TZInfo :: timezone.teet ('EST') puts time_in_est = est_tz .tc_to_local (input_time ) "Time_in_est = # {time_in_est}"  

What we're doing here:

  • Parsing the given date string
  • Change it to UTC
  • Use the Tizino gem to view timezone information for 'EST' (which I believe is 'eastern time') < / Li>
  • When TC input to convert time in local time for the EST timezone

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -