Krishnan Kannan
Krishnan Kannan

Reputation: 21

EPPLUS excel creation with date format on C#

I set custom date format(dd-MMM-yyyy) in excel via EPPlus code is not working, when the first record of date column(ex. D2 (DeliveryDate) ).

ws.Column(ColumnNumber).Style.Numberformat.Format = "dd-MMM-yyyy"

Upvotes: 2

Views: 445

Answers (1)

Scott
Scott

Reputation: 4163

"dd-MMM-yyyy" isn't always a valid Excel date format, its not on my machine set to Australian English.
In excel date time formats are all lowercase. Presumably excel distinguishes between Month and minute by context.
Create a custom date or time format

So "dd-mmm-yyyy" will work But "dd-MMM-yyyy" will not (always) work.

Upvotes: 1

Related Questions