Get System.DateTime on Oculus Quest Android Build.
I’m trying to create a script to check if the current date is past a specific date for an Oculus Quest 2 app. It all works in editor fine. But whenever I do the build to the quest this line fails “System.DateTime expirationDate = System.DateTime.Parse(m_stringExpireDate);” So there seems to be an issue with System.DateTime on Quest builds. Has anyone else experienced this or know any way around it, maybe another way to get the date that doesn’t use System.DateTime?
//Preform the date check.
private void DoCheck()
{
debugText.text = "Getting Date...";
//This line fails on quest build.
System.DateTime expirationDate = System.DateTime.Parse(m_stringExpireDate);
Debug.Log("Expire Date: " + expirationDate.Day + " " + expirationDate.Month + " " + expirationDate.Year);
debugText.text = "Expire Date: " + expirationDate.Day + " " + expirationDate.Month + " " + expirationDate.Year;
if (System.DateTime.Now >= expirationDate)
{
Debug.Log("Lisence Expired!");
onExpired.Invoke();
//Application.Quit();
}
}
Answer by danielos1996 · Feb 26, 2021 at 02:51 PM
Ah Turns out windows date is day/month/year where as quest is as month/day/year. Flippin Americans hai.
Your answer
Follow this Question
Related Questions
Alarm Clock Using System Time 0 Answers
Get device time type(24h or am/pm) 0 Answers
DateTime with countdown 0 Answers
Can I run this(pretty please?) 0 Answers
How to patch on Windows build game 0 Answers