时间转换和密码,手机的re模块简单校验 import re,time def check_userinfo(request): pwd = request.POST.get("pwd") if "_" in pwd or re.findall("\W",pwd): return False,"pwd must be number or alpha" tel = request.POST.get("tel")…
// 将时间戳转换成日期格式: function timestampToTime(timestamp) { var date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000 var Y = date.getFullYear() + '年'; var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '月'; var D = (dat…
//type为1则转换成yyyymmdd格式,type为2则转换成yyyymm格式 function formatTime(time,type){ var temp_time=new Number(time); var temp_date=new Date(temp_time); var temp_year1=""; var temp_month1=""; var temp_day1=""; if(type==1){ temp_year1=tem…
from django.contrib import admin from django.urls import path from app01 import views urlpatterns = [ path('admin/', admin.site.urls), path('test/',views.test) #测试form组件的路由 ] from django.shortcuts import render,HttpResponse from django import forms c…