Apr 28, 2011 #1 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.
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.
Apr 28, 2011 #2 majlumbo Programmer Joined Jul 13, 2010 Messages 295 Location US You should be able to get the date selected by : showMessage(DateToStr(MonthCalendar.date)); Upvote 0 Downvote
Apr 29, 2011 #3 djjd47130 Programmer Joined Nov 1, 2010 Messages 480 Location US 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 Upvote 0 Downvote
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