Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-08

convert "Januar 2016" to TDateTime using StrToDate

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Landmesser John

just curious: should be possible?

StrToDate('Januar 2016','mmmm yyyy', ' ')

but i get ConvertError

Tipps are welcome

Found a german hint in DelphiPraxis:

die Format-Strings derUnitSysUtils sind eher auf die Ausgabe gerichtet. Beim Parsen von Strings bist du abseits des unterstützten Normalfalls (nur Zahlen und Trennzeichen) auf deine eigene Findigkeit angewiesen.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160824/d9d5c749/attachment.html>

Reply by email

Landmesser John
to Landmesser John

sorry, lhelp knows the answer:

Show quoted text 6 lines
StrToDate converts the string S to a TDateTime date value. The Date must consist of 1 to three digits, separated by the DateSeparator character. If two numbers are given, they are supposed to form the day and month of the current year. If only one number is given, it is supposed to represent the day of the current month. (This is not supported in Delphi)
Landmesser John wrote 18 lines
just curious: should be possible? StrToDate('Januar 2016','mmmm yyyy', ' ') but i get ConvertError Tipps are welcome Found a german hint in DelphiPraxis: die Format-Strings derUnitSysUtils sind eher auf die Ausgabe gerichtet. Beim Parsen von Strings bist du abseits des unterstützten Normalfalls (nur Zahlen und Trennzeichen) auf deine eigene Findigkeit angewiesen.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160824/04ffbf6e/attachment.html>

Reply by email

Michael Van Canneyt
to Landmesser John: just curious: should be possible? StrToDate('Januar 2016','mmmm yyyy', ' ') but i get…
Landmesser John wrote 13 lines
just curious: should be possible? StrToDate('Januar 2016','mmmm yyyy', ' ') but i get ConvertError Tipps are welcome Found a german hint in DelphiPraxis: die Format-Strings derUnitSysUtils sind eher auf die Ausgabe gerichtet. Beim Parsen von Strings bist du abseits des unterstützten Normalfalls (nur Zahlen und Trennzeichen) auf deine eigene Findigkeit angewiesen.

Try scandatetime from the dateutils unit.

Michael.

Reply by email