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

448
Views
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 answers
Answer question

0

DateTimeFormatInfo.CurrentInfo.ShortDatePattern are just format string.

Try

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

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 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!