Exemplo n.º 1
0
def convert_to_ad(bs_date):
    date_components = decompose_date(bs_date)
    year, month, day = date_components
    validate_date_bs(year, month, day)

    ad_year, ad_month, ad_day = _bs_to_ad(year, month, day)
    return "{}-{}-{}".format(ad_year, ad_month, ad_day)
Exemplo n.º 2
0
def convert_to_bs(ad_date):
    date_components = decompose_date(ad_date)
    year, month, day = date_components
    validate_date_ad(year, month, day)

    bs_year, bs_month, bs_day = _ad_to_bs(year, month, day)
    return "{}-{}-{}".format(bs_year, bs_month, bs_day)