Last active
March 14, 2017 07:35
-
-
Save RareScrap/945b2b6d90a596d7f7ee82e13a151835 to your computer and use it in GitHub Desktop.
Поправка на часовой пояс устройства Android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Calendar calendar = Calendar.getInstance(); // Объект Calendar | |
calendar.setTimeInMillis(timeStamp * 1000); // Получение времени | |
TimeZone tz = TimeZone.getDefault(); // Часовой пояс устройства | |
// Поправка на часовой пояс устройства | |
calendar.add(Calendar.MILLISECOND, tz.getOffset( calendar.getTimeInMillis() )); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment