796
Views
9
Comments
How to convert datetime and get in DD MMM YYYY format in attribute

I tried using the built-in functionality FormatDateTime to convert datetime dataype to achieve in the format DD MMM YYYY (i.e 2022-11-09 04:51:52 to 09 NOV 2022), but it's not applicable 

Is there any other way or functionalities to apply and achieve this.


2018-10-29 08-31-03
João Marques
 
MVP

Hi Ajith,


What problem are you having? In any given expression, FormatDateTime function helps you achieve this, like in the example below:


Like you can see on my screenshot, by hovering the function name, it shows a description on how to use it and examples.


Kind Regards,
João

2023-01-17 13-43-47
Akhila K Soman

Hi Ajith,

It is not clear how you are passing the date.

If you are passing a variable of date time datatype it would work fine.

If it is of someother datatype like text variable containing the date time value then you have to convert it to date time and pass it.

Try using the any of the following formats for example. 

FormatDateTime(#2022-11-09 04:51:52#,"dd MMM yyyy")  or FormatDateTime(TextToDateTime("2022-11-09 04:51:52"),"dd MMM yyyy").

Hope this helps.

Thanks,

Akhila

UserImage.jpg
Ajith Bhat

Hello Akhila ,

I tried as per above instructions still I didn't get it.

I'll explain you in brief what's the requirement,

this is our entity

here Created date time records currdatetime() as per built-in function during saving of data

And its getting stored here like this as required, but to the front-end on website we need to display this in DD MMM YYYY format like this below so if I try to call this function in the aggregate and getting this error "'FormatDateTime' function cannot be executed in the database, so it can't receive any attributes from the aggregate as parameter."

Regards,

Ajith

2021-08-12 05-19-40
Shubham Janbandhu

Hi Ajith,

you cannot use FormatDateTime() condition in database, use it in frontend like this.

Use this condition inside table.

Best Regards,

Shubham

2023-04-16 15-25-31
Krishnanand Pathak

Hi @Ajith Bhat ,

Instead of doing this. Why don't you just use the function in the expression like

FormatDateTime(GetUsers.List.Current.User.Creation_Date, "dd MMM yyyy")

to display the date on screen.

Thanks & Regards

Krishnanand Pathak



UserImage.jpg
Ajith Bhat

Hello Krishnanand Pathak 

But I want FormatDateTime function to be used in the aggregate in order to fetch that data in Datagrid that is I have to bind it to the DATAGRID to display we can't use the function in the aggregate 

here I have to bind

Regards, 

Ajith 

2021-08-12 05-19-40
Shubham Janbandhu

Hi Ajith, 

For Datagrid, we have property DateTimeOptionalConfigs inside that have Format property you can refer this.

 




Regards,

Shubham

UserImage.jpg
Ajith Bhat

Hello all I have got the solution 

In order to get desired date format in Data-grid use 

this, where you can get desired format.

UserImage.jpg
Shawn Scott

Thank you for answer. I could have swore I tried that but maybe other variation except that. That does solve the problem. Now, I'm on to the next problem. 

Thank you for the guidance on this one. 

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