-1

I am attempting to query table storage by generating the following query:

var date = new DateTime(1954, 9, 7);
var timequery = TableQuery.GenerateFilterConditionForDate("Timestamp", QueryComparisons.LessThanOrEqual, date.ToString());

I am getting a bad request when simply doing date.ToString()

The string that I need would be in the following format: 1954-09-07T07:00:00.0000000Z

How do I convert a regular DateTime to be a string in the specified format?

Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062

1 Answers1

1

Var date = new DateTime(1954,7,0,0,0,0,DateTimeKind.Utc);

Var stringDate = date.ToUniversalTime().ToString(“o”);

Gives you the required result as 1954-09-07T00:00:00.0000000Z

siri
  • 114
  • 1