6313
Views
9
Comments
Solved
[Custom Input Masks] How to format date time?
Question
custom-masks
Web icon
Forge asset by Sara Gonçalves

Does it support date time formatting? It will behave strangely when time format is set.

Can you help?

2023-12-07 07-51-40
Remco Dekkinga
 
MVP
Solution

Hi Eric,

The CustomMasks will let you format date time, but there is a catch. 

The OutSystems platform has a default DataTime format which can be set in ServiceCenter. This is the format OutSystems expects when entering a date time in an input. When your mask is requiring a different format, you have to have a variable with type Text in order to get the correct value. In the action that uses the date time, you have to change the Text variable into a Date Time variable in order for OutSystem to understand the Date Time value. In the preparation of your screen you have to have an action that converts the Date Time into the Text including the correct formatting for the custom mask to understand.

Kind regards,

Remco Dekkinga


2018-08-06 13-40-17
Ramakrushnarao Seera

Hi Eric,

In out systems you can do data format in below ways.

1. 

FormatDateTime(value,format)DateTimeToDate()
DateTimeToText()
DateTimeToTime()
DateToDateTime()
DateToText()
TextToDate()
TextToDateTime()
TextToDateTimeValidate()
TextToDateValidate()


Date_PrettyFormat(Date),
DateTime_PrettyFormat(DateTime)

this is the function provided by outsytesms,

2.   you can configure data format form service center (administration tab)

3.   If all above formats doesn't helps your need.. Just write an extension which will take care of your fomat..


Thanks,

Rocky

UserImage.jpg
Devjyoti Pal

Instead of dd-mm-yyyy , I want mm-dd-yyyy. Is it possible?

2019-05-22 11-30-09
Marcelo Ferreira

Hi Devjyoti,

Yes it is possible. MaskDate has 1 input called DateFormat and you can set the format you want.

Regards,

Marcelo


UserImage.jpg
Devjyoti Pal

Marcelo Ferreira wrote:

Hi Devjyoti,

Yes it is possible. MaskDate has 1 input called DateFormat and you can set the format you want.

Regards,

Marcelo


Hi Marcelo , thanks for the reply.

Can you please tell me the steps.


2019-05-22 11-30-09
Marcelo Ferreira

Check this:

Regards,

Marcelo

UserImage.jpg
Devjyoti Pal

Marcelo Ferreira wrote:

Check this:

Regards,

Marcelo

Hi Marcelo,

Is it only for Web or its for Mobile also ?


2019-05-22 11-30-09
Marcelo Ferreira

Is only for web. For mobile try this one https://www.outsystems.com/forge/component/2258/input-masks-mobile/

Regards,

Marcelo

2020-11-20 06-58-18
Prince Kumar

Hope this will help you to change DateTime Format

FormatDateTime(CurrDate(),"dd-MMM-yyyy")




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