Bonjour,
J'ai l'information suivante en format string :
Je voudrais la placer dans un TDateTime.Code:
1
2 2006/12/26 21:00
Cette date n'a pas le format standard, comment puis-je faire ?
Merci,
MaTHieU_
Version imprimable
Bonjour,
J'ai l'information suivante en format string :
Je voudrais la placer dans un TDateTime.Code:
1
2 2006/12/26 21:00
Cette date n'a pas le format standard, comment puis-je faire ?
Merci,
MaTHieU_
Bonsoir,
J'ai fais ça :
Est-ce correct ?Code:
1
2
3
4
5
6
7
8
9
10
11
12
13 MaDate := EncodeDate( StrToInt(Memo1.Lines.Strings[0].Substring(0,4)), StrToInt(Memo1.Lines.Strings[0].Substring(5,2)), StrToInt(Memo1.Lines.Strings[0].Substring(8,2))); MaDate := MaDate + EncodeTime( StrToInt(Memo1.Lines.Strings[0].Substring(11,2)), StrToInt(Memo1.Lines.Strings[0].Substring(14,2)), 0, 0); FormatDateTime('yyyy-mm-dd hh:nn:ss',MaDate)
Peut-on faire plus optimisé, plus propre ?
Merci,
MaTHieU_
Et en regardant du côté de StrToDateTime et FormatSettings?