<s> from django import template <EOL> import pytz <EOL> from corehq . util . timezones . conversions import ServerTime <EOL> register = template . Library ( ) <EOL> @ register . simple_tag <EOL> def utc_to_timezone ( date , timezone ) : <EOL> if not timezone : <EOL> timezone = pytz . utc <EOL> if not date : <EOL> return "<STR_LIT>" <EOL> if isinstance ( date , basestring ) : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> return ServerTime ( date ) . user_time ( timezone ) . ui_string ( ) </s>
