标签: django
导入BaseCommand 从django.utils导入时区
class Command(BaseCommand): help ='显示当前时间'
def handle(self, *args, **kwargs): time = timezone.now().strftime('%X') self.stdout.write("It's now %s" % time)