https://github.com/juborajnaofel/phptimezoner
Timezone your php based application
https://github.com/juborajnaofel/phptimezoner
datetime php timezone timezone-conversion
Last synced: about 1 year ago
JSON representation
Timezone your php based application
- Host: GitHub
- URL: https://github.com/juborajnaofel/phptimezoner
- Owner: juborajnaofel
- License: mit
- Created: 2024-02-06T15:33:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-06T15:44:08.000Z (over 2 years ago)
- Last Synced: 2025-02-28T02:19:28.251Z (over 1 year ago)
- Topics: datetime, php, timezone, timezone-conversion
- Language: PHP
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# phptimezoner
When you are working with different timezones, you may store time in user's timezone store them in UTC and later retrieve again. This is how you could do that.
Usage syntax
```php
$timeZoner = TimeZoner::get();
$utc = $timeZoner->anyToUTC('Asia/Dhaka', '2023-10-1 1:00:00', $outputFormate = 'Y-m-d H:i:s', $formateIndex = null, $show = true);
$timeZoner->fromUTCtoAny('Asia/Dhaka', $utc, $outputFormate = 'Y-m-d H:i:s', $formateIndex = null, $show = true);
$timeZoner->currentUTC($outputFormate = 'Y-m-d H:i:s', $formateIndex = null, $show = true);
$timeZoner->currentAny('Asia/Dhaka',$outputFormate = 'Y-m-d H:i:s', $formateIndex = null, $show = true);
```