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

449
Vistas
Unity - How to get date format of device on Android?

I'm trying to get the date format of the device in my game. I changed my date format to month/day/year in the device's settings and the code down below gave me "MM/dd/yyyy" in the log. Then I changed my date format to day/month/year but still the log was "MM/dd/yyyy".

How can I get the date format in Android?

I'm using a class in the System.Globalization library

Debug.Log(DateTimeFormatInfo.CurrentInfo.ShortDatePattern)

I also tried to restart the device after changing the date format in the settings, but it didn't work.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

DateTimeFormatInfo.CurrentInfo.ShortDatePattern are just format string.

Try

 Debug.Log(System.DateTime.Now.ToString(DateTimeFormatInfo.CurrentInfo.ShortDatePattern));
over 4 years ago · Santiago Trujillo Denunciar

0

Maybe try.

String DateString = system.datetime.now.tostring;

String[] BreakUp1 = DateString.split(',');

String[] BreakUp2 = BreakUp1.split('/');

String newDate = BreakUp[1] + "/" + BreakUp[0] + "/" + BreakUp[2];

This will create dd/mm/yyyy if the format is originally coming out mm/dd/yyyy.

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