Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

110
Views
Issue with Azure mobile service string/date column when queried by app

I have a Mobile Service on Azure and one of my columns (named InputDate) is set as type string. An example value is 2015-07-23T18:00:00Z (ISO 8601 format)

However, when I query this table with the following code:

List<MyTable> MyTableData = await TheTable.Where(t => t.Name == "test")
                                          .OrderByDescending(t => t.__createdAt)
                                          .ToListAsync();

And then when I print out the date using:

Debug.WriteLine(MyTableData[MyTableData.Count-1].InputDate);

It looks like this 07/23/2015 18:00:00 which is a completely different format and doesn't include the T/Z separators and also leads to a System.FormatException: String was not recognized as a valid DateTime. exception when I call DateTime.Parse with the date as the argument.

I'm really not sure why this would be, I know I should probably have the column set as type date, but forgetting that it's a date, as a string it should display exactly as is in Azure, or at least that's what I would like to happen.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try converting the "DateTime" string property to a datetime with the DateTime.ParseExact static function.

For example: String strDate = "2015-07-23T18:00:00"; DateTime mydate = DateTime.ParseExact(strDate, "yyyy-MM-ddTHH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!