<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' <EOL> __license__ = '<STR_LIT>' <EOL> from datetime import date , datetime <EOL> import date_converter as converter <EOL> def convert_from_string ( string , current_format , to_format , to_type = str ) : <EOL> if to_type == str : <EOL> return converter . string_to_string ( string , current_format , to_format ) <EOL> elif to_type == datetime : <EOL> return converter . string_to_datetime ( string , current_format , to_format ) <EOL> elif to_type == date : <EOL> return converter . string_to_date ( string , current_format ) <EOL> elif to_type == float : <EOL> return converter . string_to_timestamp ( string , current_format ) <EOL> def convert_from_datetime ( from_datetime , to_format , to_type = str ) : <EOL> if to_type == str : <EOL> return converter . datetime_to_string ( from_datetime , to_format ) <EOL> elif to_type == datetime : <EOL> return converter . datetime_to_datetime ( from_datetime , to_format ) <EOL> elif to_type == date : <EOL> return converter . datetime_to_date ( from_datetime ) <EOL> elif to_type == float : <EOL> return converter . datetime_to_timestamp ( from_datetime ) <EOL> def convert_from_date ( from_date , to_format , to_type = str ) : <EOL> if to_type == str : <EOL> return converter . date_to_string ( from_date , to_format ) <EOL> elif to_type == datetime : <EOL> return converter . date_to_datetime ( from_date ) <EOL> elif to_type == float : <EOL> return converter . date_to_timestamp ( from_date ) <EOL> def convert_from_timestamp ( timestamp , to_format , to_type = str ) : <EOL> if to_type == str : <EOL> return converter . timestamp_to_string ( timestamp , to_format ) <EOL> elif to_type == datetime : <EOL> return converter . timestamp_to_datetime ( timestamp , to_format ) <EOL> elif to_type == date : <EOL> return converter . timestamp_to_date ( timestamp ) </s>
