# coding:utf-8
#from translate import Translator
#from googletrans import Translator
from deep_translator import GoogleTranslator
from datetime import datetime, timezone, timedelta


def translate(text):
    #result = Translator().translate(text, dest='en')
    try:
        result = GoogleTranslator(source='zh-TW', target='en').translate(text)
    except:
        result = text
    #translator= Translator(from_lang="zh-tw",to_lang="en")
    #result = translator.translate(text)
    return str(result).lower()


def get_now_time():
    return datetime.now(timezone(timedelta(hours=+8))).isoformat(timespec="seconds")
