Regrading date on sharepoint

i ahve a linq query that generate a table like qty , date etc

when i am writing that on sharepoint date format that i want is MM-dd-yyyy but sharepoint its getting up like 6/1/2024 (MM/dd/yyyy) but i need 06-01-2024

when check in dt the format is ok

Hi @mint

DateTime.ParseExact("6/1/2024","M/d/yyyy",System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("MM-dd-yyyy")

HI @mint

Xaml:
Main.xaml (6.3 KB)

Regards

Hi @mint

formattedDate = DateTime.ParseExact(sharePointDate, "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("MM-dd-yyyy")

Hi @mint

You can convert the date format by using the simple expression. check the below one,

- Assign -> Input = "6/1/2024"
- Assign -> Output = CDate(Input).ToString("MM-dd-yyyy")

Check the below image for better understanding,

Hope it helps!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.