Today, we’re teaching rails, and used an example of gyms and workout classes.

To create a workout class, we needed to have duration times, and wanted to give more info about the DateTime Object.

My colleague Jon let the class know about in_time_zone which is a rails method that lets you pass a TimeZone instance or a string that identifies a time zone as an arguement, and get the simultaneous time in the given time zone.

DateTime.utc(2000).in_time_zone('Alaska') # => Fri, 31 Dec 1999 15:00:00 AKST -09:00