Hi everybody,
it's quite a time ago I used LotusScript to develop some applications so I'm a bit out of training
At the moment I'm wondering if it's possible to define a fix date separator so the date format will not use the date separator of the current locale settings of the operating system.
In detail, I retrieve a date field and modify the format with the format function like
If the current OS locale settings are set to English I get back a date in the format 01/23/2009
But in my case, the locale settings are set to German, so I get back 01.23.2009
What I want to achieve is, that regardless of the locale settings I'll get back 01/23/2009.
At the moment I implemented a workaround, checking for occurences of a "." and do a split by "." and rebuild the string from the array.
But I hope there is a "better" solution for it, since there are also different possibilities for a date separator. Some locales uses a "-" as separator, so my work around wouldn't work.
So, is there a way to use the Format function and define a fix date separator which should be used?
Thanks a lot for any advices in advance!
Cheers
preachie
it's quite a time ago I used LotusScript to develop some applications so I'm a bit out of training
At the moment I'm wondering if it's possible to define a fix date separator so the date format will not use the date separator of the current locale settings of the operating system.
In detail, I retrieve a date field and modify the format with the format function like
Code:
d = Format(da, "mm/dd/yyyy")
If the current OS locale settings are set to English I get back a date in the format 01/23/2009
But in my case, the locale settings are set to German, so I get back 01.23.2009
What I want to achieve is, that regardless of the locale settings I'll get back 01/23/2009.
At the moment I implemented a workaround, checking for occurences of a "." and do a split by "." and rebuild the string from the array.
Code:
If(Instr(d, ".") > 0) Then
dateArray = Split(d, ".")
d = dateArray(0) + "/" + dateArray(1) + "/" + dateArray(2)
EndIf
But I hope there is a "better" solution for it, since there are also different possibilities for a date separator. Some locales uses a "-" as separator, so my work around wouldn't work.
So, is there a way to use the Format function and define a fix date separator which should be used?
Thanks a lot for any advices in advance!
Cheers
preachie