Roland Tanglao
About

Me:: this is where i found out about utc_to_local ;; date - Ruby local_to_utc returns invalid year - Stack Overflow

Jun 16, 2025

Discovered: Jun 16, 2025 00:09 Me:: this is where i found out about utc_to_local ;; date - Ruby local_to_utc returns invalid year - Stack Overflow

QUOTE:

See my code in : blogthis.rb

t = TZInfo::Timezone.get('America/Vancouver').utc_to_local(DateTime.parse(created_at))

Inspired by:

TZInfo::Timezone.get('US/Eastern').local_to_utc(DateTime.parse(date_src))
# => #<DateTime: 2014-07-08T03:10:00+00:00 ((2456847j,11400s,0n),+0s,2299161j)>

Leave a comment on github

Roland Tanglao

  • Roland Tanglao
  • roland@rolandtanglao.com
  • rtanglao
  • rtanglao

flickr.com/roland, twitter.com/rtanglao #firefox #thunderbird