A small Expo + React Native app that shows live local times for several cities and pulls current temperature from OpenWeatherMap. Designed for quick viewing of global time + weather in a circular, card-style UI.
- Live clock (updates every second)
- Current temperature (Celsius) for each city via OpenWeatherMap
- Clean circular UI with background image
- Built with Expo + React Native
Cities shown by default: Kolkata, Paris, New York, London, Tokyo, Sydney.
- React Native (Expo)
- OpenWeatherMap API
- Main component:
TimeZoneStatus.js
- Node.js (14+ recommended)
- npm or yarn
- Expo CLI (optional;
npm startuses the localexpopackage) - Android emulator or a physical device with Expo Go
- Install dependencies
cd TimeZone
npm install- Start Expo
npm start
# or run on Android emulator/device
npm run android- Open in Expo Go (scan QR) or use an emulator.
Note:
npm run iosworks on macOS only.
The app fetches temperatures from OpenWeatherMap. You MUST provide your API key before the weather requests will succeed.
Two ways to add your key:
- Quick (edit file)
- Open
TimeZoneStatus.jsand replace theapiKeyvalue with your key.
// inside TimeZoneStatus.js
const apiKey = 'YOUR_OPENWEATHERMAP_API_KEY';- Recommended (don’t commit keys)
- Use environment/config solutions (e.g.
app.jsonextra+expo-constants,react-native-dotenv, or EAS secrets) and read the key at runtime.
⚠️ Important: Do not commit your API key. Add any local.envfiles to.gitignore.
- Times are produced with
new Date().toLocaleString(..., { timeZone })and updated every second withsetInterval. - Weather is fetched from OpenWeatherMap's
/weather?q=<city>endpoint and displayed in °C.
Files to look at:
TimeZoneStatus.js— UI + logic for times and weatherApp.js— app entry (rendersTimeZoneStatus)
- Change shown cities: edit the
citiesarray inTimeZoneStatus.js. - Switch units (°C → °F): modify the
unitsquery param in the fetch URL. - Replace background image or adjust styles in the
stylesobject.
- Weather shows
N/A→ check your OpenWeatherMap API key and network connectivity. - App won't start → run
npm installandnpm start -- --clearto clear Metro cache. - Android device not detected → ensure emulator is running or the physical device is connected (use
adb devices).
- Move API key into secure env/config
- Add selectable cities and persistent settings
- Add a forecast card (3-day / hourly)
- Improve error UI for failed API calls
Feel free to open issues or PRs. Keep changes focused and add tests or screenshots when possible.
MIT — see LICENSE (or add one if you need a specific license).
If you'd like, I can (optionally) replace the hard-coded API key with a secure app.json/.env-based approach — tell me which method you prefer and I will implement it. ✨