I can’t get this to return a 4 digit year even when System settings are dd/mm/yyyy
Using d.shortdate is buggy on some European systems so I’ve been using this to convert a date (d) to a shortdate string.
Using xojo.core
Return DateToStringBase(d, Date.FormatStyles.short, Date.FormatStyles.None)
Private Function DateToStringBase(d as Date, dateFormat as Xojo.Core.Date.FormatStyles, timeFormat as Xojo.Core.Date.FormatStyles) as String
Using xojo.core
Dim noTimeZone As New timezone(0)
Dim d2 As New Date(d.TotalSeconds - 2082844800, noTimeZone)
Return d2.ToText(Locale.Current, dateFormat, timeFormat)
End Function
always returns dd/mm/yy which is not suitable for old dates where the system confuses the century.