I have a server configured to time zone IST which is GMT+5:30 and on everyday new JSON file will be generated using Cron job. Generated filename would be 1551139200000.json ie.GMT: Tuesday, February 26, 2019 12:00:00 AM.
How to make this file available to android app only on/after 12:00AM. Currently it could be available to all time-zone which were not hit 12:00 AM. In this case it should access previous day's Json file.
// normal code here.
long fullMsecs = System.currentTimeMillis();
long ist_offset = 330*60*1000;
long filename = (fullMsecs + ist_offset)/86400_000 * 86400_000;
Log.d(TAG, "onCreate:filename" + filename);
// filename would be affixed with required file extension.
PS: this logic is available in famous crossword like puzzle Bonza. In that game new puzzle will be accessed on start-of-the-day ie, 12:00 AM.