We want to convert string to date in MAC.
We have used following code for MAC
dim labeldate As String="01-July-2016"
dim versionDate As new Date
dim Convert As Boolean=ParseDate(labeldate,versionDate)
if Convert then
CurrentVersionDate=versionDate
end if
This works fine when in system preferences/date and time/Language and Region- Region selected =India
but when Region selected =United states then conversion fails
What we need is which string representation should be used as parameter to parse date irresepective of locale
With Xojo.Core.Date.FromText ,it gives Runtime exception with reason as ‘Parse error: date needs to be in the format of YYYY-MM-DD HH:MM or YYYY-MM-DD’
What we want is to convert abbreviated date as string into Date
If your strings are all of the format 01-July-2016 or 05-August-2014, because of local variation in how AbbreviatedDate is rendered, I suspect that sometimes in some parts of the world this will not be recognized as a date.
So I think you have to write a routine to take 01-July-2016 and get out the pieces manually
Something along the lines of:
[code]Dim theDay As Integer
Dim theMonth As Integer
Dim theMonthCharacters As String
Dim theYear As Integer