Hi everyone.
Currently my SmartDates are being formatted using the following in the FormatString() method in the smartdate class.
mFormat = "G"
This works great and displays my date's in the following manner.
4/14/2005 12:00:00 A.M.
The issue is, there is one smatdate that I want to just display as a shortdate. How can I format this on instance of smartdate as the shortdate?
Any help greatly appreciated.
VisualStudio2005 Windows Project
CSLA Ver.2
By the way.. figured I'd add some detail... here is the property I use
Public ReadOnly Property LastInspectionDate() As SmartDateI've tried the following line of code, but I get the following error of course.
return _lastInspectionDate.Date.ToString("MM/dd/yyyy");
Value of type 'String' cannot be converted to SmartDate
Hi reagan123,
The SmartDate class uses the date format "d" as default. You can call the shared method SetDefaultFormatString("G") on the SmartDate class. After that, you can use the Text property of the SmartDate instance to get the string representation of the date.
For your _lastInspectionDate property, you should set the FormatString property of the instance to "MM/dd/yyyy". (you can do that immediately after you've created the object) After that, the Text property should return the date in the desired format.
Hope this helps,
Cheers,
Herman
thanks again guys... It works great now.
I believe this forum is 3 for 3 know on my questions
Copyright (c) Marimer LLC