Convert Date to DD Mon YYYY

Convert Date to DD Mon YYYY

  

Hello,

I have a date (2017-07-10) and i want to display as 07 October 2017.

I do some research and it say to use this function , FormatMonthDayDateFunction

https://www.outsystems.com/help/servicestudio/9.0/Language_Reference/Built_in_Functions/Formatting_functions/FormatMonthDayDate_Function.htm

So in my expression, i put as FormatMonthDayDate(StartDate, " ") and it say unknown function 'FormatMonthDayDate' in expression. May i know what wrong?


The second parameter is probably the desired format you want.

You probably want something like this:
"dd MMMM yyyy"


Take a look at this page for available formats
https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings

Hi,

can you share what you are doing exactly?

I have done it with no problem..


Hi,

Use the Builtin function FormatDateTime:

Pass the Date/DateTime in the first parameter and the format in the second "dd MMMM yyyy"

Cheers,
Eduardo Jauch

Oops, unknown function 'FormatMonthDayDate', didn't see that.


Make sure you have actually referenced the function for use in your current module.

J. wrote:

Hi,

can you share what you are doing exactly?

I have done it with no problem..


I think that at least in OutSystems 10, that function is not a Bultin function...
I couldn't find it anyway.

Just found FormatDateTime

Cheers,
Eduardo Jauch

well, there is that :D

I did it in 9.1 and it was still there (since he used the link with 9.0....)


It's a function in 9.1 and earlier:

But no longer in 10 and up:

It's listed in the Breaking Changes document for P10:

Side Effects


Built-in Functions

1.

Issue: Date and time format built-in functions were replaced by built-in function FormatDateTime, which allows formatting a Date Time value using the specified format. The upgrade process automatically changes existing modules to keep the previous behavior using built-in function FormatDateTime.

Stack: .NET, Java

Rationale: Maintain only one generic function.

Workaround: None.

Jace Jace: I assume you are on P10. Please check the version number of the things you research, so you won't inadvertently assume it's valid for the latest version.

Yes, i am using P10. Thanks for pointing out. Will be careful next time when i research. :)

Jace Jace wrote:

Yes, i am using P10. Thanks for pointing out. Will be careful next time when i research. :)


 I Have the same problem to, i want to show just ther year of the date. But i can't cahnge the value can you tell me how? 

Thank you

Hi Desanti,

FormatDateTime takes a formatting string, as the help information clearly shows:

So it's just a matter of specifying the right format (if you want just the year, use "yyyy"). However, there's also a built-in Function "Year" that returns just the year, which is perhaps better to use:

Kilian Hekhuis wrote:

Hi Desanti,

FormatDateTime takes a formatting string, as the help information clearly shows:

So it's just a matter of specifying the right format (if you want just the year, use "yyyy"). However, there's also a built-in Function "Year" that returns just the year, which is perhaps better to use:


But if I use extract year from date time It will be static, i want it to be dynamic (current year or can select like selecting month in combo box). Can you tell me how? 

Desanti Nurma wrote:

Kilian Hekhuis wrote:

Hi Desanti,

FormatDateTime takes a formatting string, as the help information clearly shows:

So it's just a matter of specifying the right format (if you want just the year, use "yyyy"). However, there's also a built-in Function "Year" that returns just the year, which is perhaps better to use:


But if I use extract year from date time It will be static, i want it to be dynamic (current year or can select like selecting month in combo box). Can you tell me how? 

Year(CurrDate())

?


Eduardo Jauch wrote:

Desanti Nurma wrote:

Kilian Hekhuis wrote:

Hi Desanti,

FormatDateTime takes a formatting string, as the help information clearly shows:

So it's just a matter of specifying the right format (if you want just the year, use "yyyy"). However, there's also a built-in Function "Year" that returns just the year, which is perhaps better to use:


But if I use extract year from date time It will be static, i want it to be dynamic (current year or can select like selecting month in combo box). Can you tell me how? 

Year(CurrDate())

?


I tried but it can't. Should I use expression or what? I tried it with text box and fill the default value with Year(CurrDate()) but it doesn't work


Hi Desanti,

I'm not sure I understand what you want, but I doubt it has to do with date formatting. I'll therefore close this topic, please create a new one describing what you want (with the combo box and whatnot).