836
Views
9
Comments
How to change mobile app date format dd-mm-yyyy to mm-dd-yyyy
Question

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

2024-02-27 12-57-22
Sam Rijkers

Hi Hitesh,

Check out this post by an OutSystems employee; (Mobile apps follow the device settings for date and number format).


2023-09-06 11-31-56
Hitesh Maran

Hi Sam,

Thanks for reply, I already read that post you suggest it's not what i was looking for.


-Hitesh

2026-03-16 00-00-40
Palak Patel

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


Regards,
Palak Patel

2023-09-06 11-31-56
Hitesh Maran

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. 


 -Hitesh

2018-09-18 10-51-52
myzsk

Hi Hitesh,

Are you set "Input Type" in input text 'Date' ?

Regards,

Muhammad Agil

2023-09-06 11-31-56
Hitesh Maran

Hi Muhammad,

Yes, I am using Input type as Date.


-Hitesh

2025-04-22 05-54-18
Shashi Kant Shukla

Hi Hitesh,

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-

2021-11-07 06-55-04
Shmayah Legomsky

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


2021-11-07 06-55-04
Shmayah Legomsky

Would like to add that I am now using the NEW date picker of Outsystems and I don't need the above solution anymore

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.