pioug70
Messages postés14Date d'inscriptionlundi 13 janvier 2003StatutMembreDernière intervention27 mars 2006
-
6 mars 2006 à 14:22
pioug70
Messages postés14Date d'inscriptionlundi 13 janvier 2003StatutMembreDernière intervention27 mars 2006
-
6 mars 2006 à 17:41
Bonjour,
Je souhaite transformet une chaine contenant une date
Sat, 18 Feb 2006 13:45:00 GMT
En format
Y-m-d H:i:s
Et inversement
Est ce qu'il existe une fonction
pioug70
Messages postés14Date d'inscriptionlundi 13 janvier 2003StatutMembreDernière intervention27 mars 2006 6 mars 2006 à 17:41
Merci mais je travail en ASP tout court
Dim loMonths
loMonths = Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
function GetSqlDate(psGMTDate)
Dim loD
loD = Split(psGMTDate , " ")
Dim loT
loT = Split(loD(5))
Dim lnMonth
lnMonth = monthToNumber(loD(2))
Dim lnYear
lnYear = loD(3)
GetSqlDate = loD(1) & "/" & lnMonth & "/" & lnYear & " " & loD(4)
End Function
function monthToNumber(psMonth)
dim cpt
cpt = 1
for each lsMonth in loMonths
if(lsMonth = psMonth) Then
if cpt < 10 Then
monthToNumber = "0" & cpt
Else
monthToNumber = cpt
End If
End If
cpt = cpt + 1
Next