So you wonder why in your Android emulator, the Date is either behind or ahead once you set it with an epoch time.
Now, here is the thing. While the emulator’s Timezone setting is set to automatically sync, it won’t when in the Android emulator.
You will have to uncheck the setting and select a Timezone manually.
- Go to Settings > Date and Time
- Uncheck Automatic time zone
- Select your desired time zone
That should do it. Your epoch converted Date object will then display the correct date.