Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MonthCalendar.

Status
Not open for further replies.

MLNorton

Programmer
Joined
Nov 15, 2009
Messages
134
Location
US
I need to get the date that I select in the MonthCalendar. I am using Delphi 7 and I haver not been able to find a solution.
 
You should be able to get the date selected by :

showMessage(DateToStr(MonthCalendar.date));
 
I prefer to use FormatDateTime as it is more customizable...

Code:
  SomeString:= FormatDateTime('m/d/yy', MonthCalendar.Date);

SomeString = '4/29/11'

You can go even further if you have Time specified too...

Code:
  SomeString:= FormatDateTime('m/d/yy h:n:s am/pm', MonthCalendar.Date);

SomeString = '4/29/11 8:53 pm'

Or, you could format it differently...

Code:
  SomeString:= FormatDateTime('mm/dd/yyyy hh:nn:ss.zzz', MonthCalendar.Date);

SomeString = '04/29/2011 20:53:48.192'



JD Solutions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top