Is there an equivalent in Delphi? I’ve looked over the documentation and can’t find anything that would give me the output I want.
Is there an equivalent in Delphi? I’ve looked over the documentation and can’t find
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
kdunlapmo, the DateTime.ToString(“s”) function return an Sortable date/time pattern; conforms to ISO 8601. this pattern is declarated as
"yyyy-MM-ddTHH:mm:ss". regardless of the culture, the date must always be returned in the same format. you can use the FormatDateTime function in delphi to format an TDateTime value into a string.you can use something like this
but you must be careful because the
-character is Substituted by the DateSeparator value and the:character is Substituted by the TimeSeparator value, both variables are depending on the Windows locale configuration. so to avoid problems getting distinct results when the culture changes you must use explicity the-and the:characters in your format string.see this sample code
Additionally you can write a function to convert an TDatetime value to the sortable format, see this sample