[Custom Masks] How to format date time?

[Custom Masks] How to format date time?

  
Forge Component
(22)
Published on 7 Mar by Jogait
22 votes
Published on 7 Mar by Jogait

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

Can you help?

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


Solution

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