Convert RC3339 date format for Eastern Standard time?

Hi

I have a website where in I have to give the time in RC3339 form, I want that RC3339 for eastern standard time. Can we do that? If so experts in the team please help me resolving this?
I have dates and results as follows:
Ydate= DateTime.UtcNow.AddDays(-1).Tostring(“yyyy-MM-ddTHH:mm:ssZ”)
Result: 2022-06-29T15:13:25Z
Tdate=DateTime.UtcNow.Tostring(“yyyy-MM-ddTHH:mm:ssZ”)
Result: 2022-06-30T15:13:25Z

How do I get this for EST ? and
covert this to regular date date format?
Thanks in Advance.

Hi,

How about the following expression?

New DateTimeOffset(DateTime.SpecifyKind(DateTime.UtcNow,DateTimeKind.Unspecified),System.TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time").BaseUtcOffset).ToString("yyyy-MM-ddTHH:mm:ss.ffffK")

Regards,