Einzelnen Beitrag anzeigen

Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.757 Beiträge
 
Delphi 10.4 Sydney
 
#7

Re: Differenz 2erDatum in Tmemo

  Alt 27. Mai 2006, 15:05
Zitat:
if TimeToStr(Now) =strtodate(WeckTime + WeckDatum) then begin da gibts aber eine fehlermeldung.
das kann auch so nicht funktionieren.

Du willst eine String (TimeToStr) mit einem Datum (TDatTime) vergleichen

Delphi-Quellcode:
if now >= strToDateTime(WeckTime + WeckDatum) then
  begin
  end;
Wobei Du auf das Datumformat in strToDateTime achten mußt.

Aus der Hilfe:
Zitat:
Category

date/time routines

function StrToDateTime(const S: string): TDateTime;

Description

Call StrToDate to parse a string that specifies a date and time value. If S does not contain a valid date, StrToDate raises an EConvertError exception.

The S parameter must use the current locale’s date/time format. In the US, this is commonly MM/DD/YY HH:MM:SS format. Specifying AM or PM as part of the time is optional, as are the seconds. Use 24-hour time (7:45 PM is entered as 19:45, for example) if AM or PM is not specified.

Y2K issue: The conversion of two-digit year values is determined by the TwoDigitYearCenturyWindow variable. For more information, see StrToDate.

Note: The format of the date and time string varies when the values of date/time formatting variables are changed.
Grüße
Klaus
Klaus
  Mit Zitat antworten Zitat