[Advanced Excel] Setting the Date format in outputted excel
Question
Forge component by Carlos Freitas

Is there a way to use this component to force Excel to format a date column to a pattern of choice? EG the format of dates in the platform is dd-mm-yyyy but we would like resultant Excel column to be a date in the format dd/mm/yyyy 

mvp_badge
MVP

You can convert the date to the format you want using the FormatDate built-in action.

mvp_badge
MVP

Paul Davies wrote:

Is there a way to use this component to force Excel to format a date column to a pattern of choice? EG the format of dates in the platform is dd-mm-yyyy but we would like resultant Excel column to be a date in the format dd/mm/yyyy 

As João Melo mentioned, at the moment you need to format before writing to excel. An upcoming version will have the option to set the number format on a cell.


mvp_badge
MVP

Paul Davies, have you been able to use the NumberFormat property when writing data to solve your issue?

I have a follow up question: when formatting the date using FormatDateTime(TextToDate(InvoiceItem.InvoiceDetails.Current.Charges.Current.ToTime), "MMM.dd.yyyy") so that it gets outputted to Excel like: Sep.03.2021 seems to make Excel think it is text. 

I can set the cell to date and choose a date format of course, but that doesn't work. Using the FormatDateTime(TextToDate(theDate), "M/d/yyyy") does work, though.

Anyone got a way around this?

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