Bonjour,
J'ai un champs date qui se présente ainsi: "20110620040000.000000-000"
Après avoir convertis le champs j'arrive à 2011-06-20 04:00:00
Maintenant pour obtenir l'heure locale:
et le résultat est 2011-06-20 au lieu de 2011-06-20 00:00:00.
Voici la fonction UTCtoDate:
Comment pourrais-je obtenir qu'il conserve les 0 à la fin?
Merci,
François
J'ai un champs date qui se présente ainsi: "20110620040000.000000-000"
Après avoir convertis le champs j'arrive à 2011-06-20 04:00:00
Maintenant pour obtenir l'heure locale:
Code:
DateAdd("h", -4, UTCToDate(objEvent.TimeWritten))
Voici la fonction UTCtoDate:
Code:
Function DateToUTC(dtmTargetDate, Q_strBias)
dtmtestdate = dtmTargetDate
'WScript.Echo dtmtestdate
dtmTargetDate = Year(dtmTargetDate)
'Wscript.Echo dtmTargetDate
dtmMonth = Month(dtmtestdate)
'WScript.Echo dtmMonth
If Len(dtmMonth) = 1 Then
dtmMonth = "0" & dtmMonth
End If
dtmTargetDate = dtmTargetDate & dtmMonth
'Wscript.Echo dtmTargetDate
dtmDay = Day(dtmtestdate)
If Len(dtmDay) = 1 Then
dtmDay = "0" & dtmDay
End If
dtmTargetDate = dtmTargetDate & dtmDay & "000000.000000"
dtmTargetDate = dtmTargetDate & CStr(Q_strBias)
' MsgBox(dtmtestdate & " " & dtmTargetDate)
DateToUTC = dtmTargetDate
End Function
Merci,
François
Dernière édition: