How do I convert this line of code to API 2. SelectedDateLabel.Value = "Selected Date: " + ThDte.LongDate
It seems from examples in this forum it is something like SelectedDateLabel.Value = "Selected Date: " + ThDte.Tostring( DateTime.FormatStyles.full)
but that seems too long. Suggestions?
BTW this basically came from the calendar window example.
Function LongDate( extends dt as DateTime ) as string
Return dt.Tostring( locale.Current , DateTime.FormatStyles.full, DateTime.FormatStyles.full )
end function
No it wouldnt but you do need to do some experimentation on your own as well
Otherwise all you end up with is cut & paste from the forums and you never learn how to do this stuff for yourself
Then you’ll need to pass in the locale also. I didn’t remember whether optional parameters before the param you pass were accepted. Sounds like not. The signature for ToString is
DateTime.ToString(loc As Locale = Nil, dateStyle As DateTime.FormatStyles =
DateTime.FormatStyles.Medium, timeStyle As DateTime.FormatStyles =
FormatStyles.Medium) As String
There are 3 parameters, all of them optional. If you want to use the 2nd only, you also have to pass the first, if I recall correctly.