Here is my problem:
I have a XElement
storing a DateTime
, and I want to get the Value property returning the DateTime
in a custom format.
I was wondering if there is a way to include a IFormatProvider
in the XElement
.
Here is my problem:
I have a XElement
storing a DateTime
, and I want to get the Value property returning the DateTime
in a custom format.
I was wondering if there is a way to include a IFormatProvider
in the XElement
.
Copyright © 2021 Jogjafile Inc.
I think you are mixing things here. The
XElement
always stores its value as a string. To get a custom date format, you need to convert this string into aDateTime
object first and then callToString
with the format you want to have.