A Simple react native module to get Timezone and Region of the Android/iOS devices.
npm install react-native-timezoneFast, privacy-first timezone and country detection for React Native with zero extra permissions.
react-native-timezone gives you:
- Current timezone ID
- Best current country from telephony (network-first, then SIM fallback)
- Locale country fallback
- Android auto-timezone setting status
READ_PHONE_STATE needed.| React Native | New Architecture | Status |
| --- | --- | --- |
| >= 0.71.0 | Supported | Compatible |
| 0.76.x | Default New Arch | Verified in this repo |
| 0.81.x | Default New Arch | Verified in example app |
Apple has deprecated CTCarrier APIs with no direct replacement. This can make telephony country unavailable on newer iOS versions, depending on device/network/privacy behavior.
Recommended pattern:
``ts`
const bestCountry =
Timezone.getRegionByTelephony() ?? Timezone.getRegionByLocale();
`bash`
yarn add react-native-timezone
For iOS:
`bash`
npx pod-install
`bash`
npx expo install react-native-timezone
npx expo prebuild
npx expo run:ios
`tsx
import { useEffect } from 'react';
import Timezone from 'react-native-timezone';
export default function App() {
useEffect(() => {
const timezone = Timezone.getTimeZone();
const isAutoTimeZoneEnabled = Timezone.isAutoTimeZoneEnabled();
const telephonyRegion = Timezone.getRegionByTelephony();
const localeRegion = Timezone.getRegionByLocale();
const bestCountry = telephonyRegion ?? localeRegion;
console.log({
timezone,
isAutoTimeZoneEnabled,
telephonyRegion,
localeRegion,
bestCountry,
});
}, []);
return null;
}
`
See the example app.
| API | Description |
| --- | --- |
| getTimeZone() | Returns current timezone ID (for example Asia/Colombo, Europe/Berlin). |isAutoTimeZoneEnabled()
| | Android only. Returns true or false; returns null on iOS. |getRegionByTelephony()
| | Returns best current telephony country (network-first, then SIM fallback) as uppercase ISO code (for example LK, US) or null. |getRegionByLocale()
| | Returns locale country as uppercase ISO code (for example LK, US) or null`. |