# Format a timestamp in the user's zone

> Store UTC. Format with the user's timezone when you send the prop. Do not save local time into a timestamp column.

- URL: https://laravel-vuejs.space/laravel-app-timezone-vue
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs, PHP

People searching “Laravel timezone Vue” set `APP_TIMEZONE` to the user’s city and then every row shifts when someone else signs in. `config('app.timezone')` is the app default. The database connection should store UTC. Convert for display.

> **TL;DR**
>
> -   Store UTC.
> -   Format with the user’s timezone when you send the prop.
> -   Do not save local time into a timestamp column.
> -   Do not store a local datetime in a `timestamp` column by formatting it in PHP and writing the string.
>
> **Who it's for:** Laravel + Vue developers
>
> **Applies to:** Laravel 13 · Vue 3

## The fix

```php
$zone = in_array($request->user()->timezone, timezone_identifiers_list(), true)
    ? $request->user()->timezone
    : config('app.timezone');

'createdAt' => $post->created_at->timezone($zone)->toIso8601String(),
```

The Vue page prints the string. It does not add an offset again. Adding it twice is how a 10:00 post becomes 12:00.

## What to avoid

> **Gotcha**
>
> Do not store a local datetime in a `timestamp` column by formatting it in PHP and writing the string. The next reader in another zone cannot undo a conversion you did not record. Do not trust a timezone name that is not in `timezone_identifiers_list()`.

## FAQ

**Q: How do I format a timestamp in the user's zone?**

Store UTC. Format with the user's timezone when you send the prop. Do not save local time into a timestamp column.

**Q: What goes wrong with Laravel timezone Vue?**

Many developers set `APP_TIMEZONE` to the user's city and then every row shifts when someone else signs in. Do not store a local datetime in a `timestamp` column by formatting it in PHP and writing the string.
