From Xojo Documentation
Converts the DateTime (along with the time component) to a string format using the optional locale and formats.
If you don't provide a locale or use a Nil locale, then the current locale (Locale.Current) is used.
Use a Locale to get a date to use for display purposes. If you provide a Locale, then the specific output formats use what is defined in the locale settings for your OS. Refer to FormatStyles for more information.
Also refer to UserGuide:Localization for information on how you can display localized values, particularly with web apps.
To get just the date portion you have to specify a Locale (not Raw). This example uses the current system locale to get just the date part for display:
Var s As String = d.ToString(Locale.Current, DateTime.FormatStyles.Short, DateTime.FormatStyles.None)
// s = 10/31/17 (this varies by date and your system locale settings)
To display just the time portion you have to specify a Locale and then provide a FormatStyle for the time: