def date_calculator(years, days, hours, minutes):
    """Add time parameters to current date and returns new date"""
    now = datetime.datetime.now()
    new_date = datetime.datetime(years + now.year, now.month, now.day,
                                 now.hour, now.minute)

    new_date += datetime.timedelta(days=days, hours=hours, minutes=minutes)
    return date_printer(new_date)
Beispiel #2
0
def main():
    y = int(input("Input years: "))
    d = int(input("Input days: "))
    h = int(input("Input hours: "))
    m = int(input("Input minutes: "))

    print("Current time is: " + date_printer(current_date))
    print("New time is: " + date_calculator(y, d, h, m))
def main():
    years = int(input("Type years: "))
    days = int(input("Type days: "))
    hours = int(input("Type hours: "))
    minutes = int(input("Type minutes: "))

    current_date = datetime.now()

    print("Current date: " + date_printer(current_date))
    print("Modified date: " +
          date_calculator(current_date, years, days, hours, minutes))
def date_calculator(current_date, years, days, hours, minutes):
    days += 365.25 * years
    new_date = \
        current_date + timedelta(days=days, hours=hours, minutes=minutes)

    return date_printer(new_date)
def main():
    date_printer(timestamp_to_date(time.time()))
Beispiel #6
0
def date_calculator(y, d, h, m):
    d += 365.25 * y
    new_date = current_date + timedelta(days=d, hours=h, minutes=m)

    return date_printer(new_date)
def main():
    print("Time: " + date_printer(datetime.fromtimestamp(time())))