Welcome, Guest
Username: Password: Remember me
CodeTyphon MS Windows (Win7, Win8.x, Win10 and Win11) OS Development, discussions and problems
  • Page:
  • 1

TOPIC:

TCalendar change date 9 hours 23 minutes ago #19404

  • Fernando Sandoval
  • Fernando Sandoval's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 45
  • Thank you received: 0
I testing and working tcalendar i need change date to day before current date 
 DTPModifiedDate.DateTime:= Date-1;

but still show me the current date selected not the previos day or day before to day..

how i can change date....   

Please Log in or Create an account to join the conversation.

TCalendar change date 7 hours 37 minutes ago #19405

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1347
  • Thank you received: 211
DTPModifiedDate.DateTime is TDateTime

You must use
procedure DecodeDate
function TryEncodeDate


from datih.inc

function DateTimeToTimeStamp(DateTime: TDateTime): TTimeStamp;
function TimeStampToDateTime(const TimeStamp: TTimeStamp): TDateTime;
function MSecsToTimeStamp(MSecs: Comp): TTimeStamp;
function MSecsToTimeStamp(MSecs: Int64): TTimeStamp;
function TimeStampToMSecs(const TimeStamp: TTimeStamp): Int64;
function TryEncodeDate(Year, Month, Day: Word; out Date: TDateTime): Boolean;
function TryEncodeTime(Hour, Min, Sec, MSec: Word; out Time: TDateTime): Boolean;
function EncodeDate(Year, Month, Day :word): TDateTime;
function EncodeTime(Hour, Minute, Second, MilliSecond:word): TDateTime;
function ComposeDateTime(Date,Time : TDateTime) : TDateTime;
procedure DecodeDate(Date: TDateTime; out Year, Month, Day: word);
function DecodeDateFully(const DateTime: TDateTime; out Year, Month, Day, DOW: Word): Boolean;    

from sysutils.pp

OR to use 
 DTPModifiedDate.Date: String;
 
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Matis A..
  • Page:
  • 1