Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

112
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda