Como a data curta é inferior a 2 dígitos, afeta a beleza ao digitar páginas da web. As duas funções a seguir podem resolver esse problema.
2020-2-7 Alterações curtas 2020-02-07 Data de longa data
Função fStime (tempos) anos, meses, dias se len (horários) = 0 então saia da função anos = ano (tempos) meses = certo ("0" & mês (horários), 2) dias = certo ("0" e dia (horários), 2) Times = anos e "-" e meses e "-" e dias de tempo = função de tempo de tempo =2020-2-7 23: 37: 5 Mudanças curtas 2020-02-07 23:37:05 Data de longa data
Function FLtime(times) Dim years,months,days,hours,minutes,seconds if len(times)=0 then exit function years=year(times):months=right("0"&month(times),2) days=right("0"&day(times),2):hours=right("0"&hour(times),2) minutes=right("0"&minute(times),2):seconds=right("0"&second(times),2) Fltime = anos e "-" & meses e "-" & Days & "" & Hours & ":" & Minutes & ":" Função SecondsendFunção de conversão de formato de data pw_sys
<%Rem pw_sys Função Função de conversão Função DatetimeFormat (DateTime, Format) Selecione FormatCase Case "1" DATETIMEFORMAT = "" & Year (DateTime) & Mês (DATETime) e mês (DATETime) & Mês "e Direita (" 0 "& Day (DateTime), 2) e" Day "Caso" 2 "2" 2 "2" 2 "2" 2 "e" 0 "e Data (DATETime), 2) e" dia "Caso" 2 "2" DIA (DATETIME), 2) & "DIA" CASO "3" DATETIMEFORMAT = "" & Year (DateTime) & "-" & Month (DateTime) & "-" & Right ("0" e dia (DATETIME), 2) e "" "e" "4" 4 "4" DATETIMATAT = "& Year (Datet)-e"/"/" Mense "e") 4 "4" 4 "DatetMeformat =" & Year (Datet) e "/"/"Mense" & ") Day(DateTime),2)&""case "5"DateTimeFormat=""&month(DateTime)&"/"&Right("0" & Day(DateTime),2)&""case "6"DateTimeFormat=""&year(DateTime)&month(DateTime)&"month"&Right("0" & Day(DateTime),2)&"day<font color=red> "& FormatDateTime (DateTime, 4) &" </font> "case" 7 "temp =" Domingo, segunda-feira, terça-feira, quarta, quinta, sexta, sábado "temp = split (temp", ") datetimeformat = temp (weekright (" 0 "& Day (DataTime), 2) -1) e" 8 "Datetformat". Dia (DateTime), 2) & "" "Caso" 9 "Se Len (Hour (DateTime)) = 1 Thenstr =" 0 "& Hour (DateTime) elSestr = Hour (DateTime) End IfDateTimeFormat = DateMeMormat (DateTime, 1) &" "10" DATETIMEformat = "" & Year (DateTime) & "Ano" & Month (DATETIME) & "Mês" Case elsedateTimeFormat = DATETimeEnd SelectEnd Função%>Código do programa (um método para converter meses e datas no formato AAAA-MM-DD em dois dígitos)
Dim hoje
hoje = data 'Evite chamadas repetidas até o momento; portanto, atribua valores a uma variável
Hoje = ano (hoje) & "-" & Right ("0" e mês (hoje), 2) & "-" & Right ("0" & Day (hoje), 2)
Uma função que preenche automaticamente a posição no ASP
Função formatSn (getNum, getBit) Dim formatsnnum, formatSnPre, formatsnjformatsnnum = getBit - len (getNum) para formatsnj = 1 para formatsnnumFormatsnPre = formatsnPre & "0" nextformatsn = formatsnpre & getNumEnd Função