![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
A powerful Python library for handling worldwide time conversions, business hours calculations, and timezone management. Perfect for applications dealing with international time coordination, business hours overlap, and holiday scheduling.
pip install worldtimeconverter
from worldtimeconverter import WorldTimeConverter
from worldtimeconverter.types import BusinessHours, HolidayDefinition
from datetime import datetime
# Get current time in any city
london = WorldTimeConverter.get_current_time('London')
print(f"London: {london.formatted_date_time}")
# Output: London: Friday, March 15, 2024 2:30:45 PM GMT
# Convert between cities
tokyo = WorldTimeConverter.convert_time(
datetime.now(),
'London',
'Tokyo'
)
print(f"Tokyo: {tokyo.formatted_date_time}")
# Output: Tokyo: Saturday, March 16, 2024 11:30:45 PM JST
# Multiple ways to specify time
from datetime import datetime
# 1. Using timestamp string
time1 = WorldTimeConverter.convert_time(
"2024-03-15 14:30:00",
'New_York',
'Singapore'
)
# 2. Using Unix timestamp
time2 = WorldTimeConverter.convert_time(
1710512345, # Unix timestamp
'London',
'Dubai'
)
# 3. Using datetime object
time3 = WorldTimeConverter.convert_time(
datetime.now(),
'Paris',
'Sydney'
)
# Custom formatting
formatted = WorldTimeConverter.convert_time(
datetime.now(),
'London',
'Tokyo',
format='%Y-%m-%d %H:%M:%S %Z'
)
# Define business hours
london_hours = BusinessHours(
start="09:00",
end="17:00",
timezone="Europe/London"
)
tokyo_hours = BusinessHours(
start="09:00",
end="18:00",
timezone="Asia/Tokyo"
)
# Calculate overlap
overlap = WorldTimeConverter.find_working_hours_overlap(
'London',
'Tokyo',
london_hours,
tokyo_hours
)
print(f"""
Working Hours Overlap:
Start: {overlap.start_time}
End: {overlap.end_time}
Duration: {overlap.overlap_duration.hours}h {overlap.overlap_duration.minutes}m
Working Days: {', '.join(overlap.working_days)}
""")
# Define holidays
christmas = HolidayDefinition(
name="Christmas Day",
date="2024-12-25",
recurring=True,
type="public"
)
new_year = HolidayDefinition(
name="New Year's Day",
date="2024-01-01",
recurring=True,
type="public"
)
# Add holidays to cities
WorldTimeConverter.add_holiday('London', christmas)
WorldTimeConverter.add_holiday('London', new_year)
# Check holidays
is_christmas = WorldTimeConverter.is_holiday(
'London',
datetime(2024, 12, 25)
)
# Calculate business days
business_days = WorldTimeConverter.get_business_days_between(
'London',
'2024-01-01',
'2024-01-10',
skip_holidays=True
)
# Get detailed city information
city_info = WorldTimeConverter.get_city_info('London')
print(f"""
City: {city_info.city_name}
Timezone: {city_info.timezone}
Current Offset: {city_info.current_offset}
DST Active: {city_info.is_dst}
Region: {city_info.region}
Subregion: {city_info.subregion}
""")
from dataclasses import dataclass
from typing import List
@dataclass
class TimeResult:
city_name: str
timezone: str
local_time: str
utc_offset: str
date: str
day_of_week: str
is_dst: bool
epoch: int
iso8601: str
formatted_date_time: str
@dataclass
class BusinessHours:
start: str # HH:MM format
end: str # HH:MM format
timezone: str
@dataclass
class HolidayDefinition:
name: str
date: str # YYYY-MM-DD format
recurring: bool
type: str
from worldtimeconverter.exceptions import InvalidCityError, InvalidTimeFormatError
try:
time = WorldTimeConverter.get_current_time('InvalidCity')
except InvalidCityError as e:
print(f"City error: {e}")
try:
hours = BusinessHours(start="9:00", end="17:00", timezone="Europe/London")
except InvalidTimeFormatError as e:
print(f"Time format error: {e}")
We welcome contributions! Here's how you can help:
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)This project is licensed under the MIT License - see the LICENSE file for details.
For more detailed documentation and examples, visit our GitHub Wiki.
FAQs
Advanced time conversion and timezone management library
We found that worldtimeconverter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.