problem with CurrDateTime() format

Hi,


I have a problem with display the CurrDateTime(), suppose dd/mm/yyyy but some pc or mobile browser is get mm/dd/yyyy. how to standard to all pc, mobile, browser to become dd/mm/yyyy hh:mm PM/AM?


Thank you


Solution

Hello Jing,

easy, use FormatDateTime(CurrDateTime(),"dd/MM/yyyy HH:mm TT")

https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Format#FormatDateTime

Hope it helps you

Carl

Solution

Hi Carl ruhle,


Thanks for ur help
But i got error after use formatdatetime.

can you help?

Hi Jing,

Use FormatDateTime() in expression when you show your datetime on screen, not in assign.

Hi Daryna,

I want to use it as input box, allow user to edit and save to DB.

How to archive it?


Thank you

jing tung wong wrote:

Hi Daryna,

I want to use it as input box, allow user to edit and save to DB.

How to archive it?


Thank you

Theres a place to specify the date format in the date picker. 

The format is just or user view. On the DB it is stored in number of seconds since 1970-01-01.

You just have to use the format to view/print, and never never to store on the DB.

If you want to store on the DB the field type would be of type text and not date.

jing tung wong wrote:

Hi,


I have a problem with display the CurrDateTime(), suppose dd/mm/yyyy but some pc or mobile browser is get mm/dd/yyyy. how to standard to all pc, mobile, browser to become dd/mm/yyyy hh:mm PM/AM?


Thank you


Hi Jing, you can use a date format function called "FormatDateTime", just follow the indication in the pic and you can format your date and present equally, check the sample and the oml and take what you need NEED

SAMPLE HERE

Hi,

The easiest solution will be to use FormatDateTime, for the format you want. The most transversal solution would be to change the date format of the server in the environment where you are.

Cheers