I want to change date format for mobile app, How do i do that. Default date format(Input type) is dd-mm-yyyy and i want my date format to be mm-dd-yyyy. I have tried couple of things i.e. Changed the environment configuration settings Date format to MM-DD-YYYY, did not work. Also tried with popup but its taking dd-mm-yyyy only.
Thanks,
Hitesh
Hi Hitesh,
Check out this post by an OutSystems employee; (Mobile apps follow the device settings for date and number format).
Hi Sam,
Thanks for reply, I already read that post you suggest it's not what i was looking for.
-Hitesh
Hi Hitesh,In Outsystems Mobile, you can use the following Built In function.Checkout this link.Example:
Syntax: FormatDateTime(#2015-06-09 10:05:20#, "ddd, dd MMM yyyy") Result: Tue, 09 Jun 2015
FormatDateTime(#2015-06-09 10:05:20#, "ddd, dd MMM yyyy")
Result:
Tue, 09 Jun 2015
Regards,Palak Patel
Hi Palak,
Thank's for reply, i tried this one too. But my case is when i click on the input box or calendar icon it prompts me calendar popup where i can select my date. if my selected date is 1 Oct 2018 it should be enter inside the text input box is 10-01-2018 which should be MM-DD-YYYY format.
Are you set "Input Type" in input text 'Date' ?
Regards,
Muhammad Agil
Hi Muhammad,
Yes, I am using Input type as Date.
You need to put a textbox and bind that textbox with a variable(SelectedDateVar) date type.
You need to call event Calendar on change and using formatDateTime function you can change datetime format as per requirement.
Regards
-SK-
Hi,
We use the date format 31/02/2022 and the system is defined as 2022-02-31
See example where you can see the date in local format below (this will be presented to the users) and the date format of the system (this will not be presented to the users but the date will be saved like this in the database):
As explained above and with some additional twisting I now have the following solution:
When the user enters data in the system:
I defined the input field with a local TEXT variable (DateVARasText) and attached a DatePicker with the Format I want:
Now when the user selects his date, the handler translates the text to the date format of the system using assign:
DateInSystem = TextToDate(Substr(StartDate,0,4)+"-"+Substr(StartDate,5,2)+"-"+Substr(StartDate,8,2))
When the user wants to review data from the system, when opening the page I have to translate the DateInSystem to text format and enter it in my local variable (DateVARasText) using assign:
DateVARasText = Substr(DateToText(MainReportById.List.Current.ActualReport.DateInSystem),8,2)+"/"+Substr(DateToText(MainReportById.List.Current.ActualReport.DateInSystem),5,2)+"/"+Substr(DateToText(MainReportById.List.Current.ActualReport.DateInSystem),0,4)
Hope this is clear enough.
Shmayah
Would like to add that I am now using the NEW date picker of Outsystems and I don't need the above solution anymore