补0打印日期

    def get_today(self):
        """
        generate today's date
        :return: str
        """
        import datetime
        year = datetime.datetime.now().year
        month = datetime.datetime.now().month
        day = datetime.datetime.now().day
        return "%4d-%02d-%02d" % (year,month,day)

你可能感兴趣的:(补0打印日期)