1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

How to display dates in Angular based on client's timezone stored in the database? [duplicate]

Discussão em 'Angular' iniciado por Gradin98, Setembro 26, 2024.

  1. Gradin98

    Gradin98 Guest

    I am working on an application that has multiple clients from different regions, including France. In my case, some of the clients are from French Guiana, which has a different timezone (GMT -3) compared to mainland France. I store the timezone for each client in the database.

    The challenge I'm facing is how to properly display dates in the client-side (Angular) based on the client's timezone, regardless of the user's local timezone. For example, if I am in Japan, I want the dates to be displayed according to the client's timezone (e.g., GMT -3 for a client in French Guiana).

    Here are the steps I am following:

    I retrieve the client’s timezone from the backend (stored in the database). I want to ensure that dates are displayed correctly in the Angular front-end using the client’s timezone, not the local timezone. What is the best approach to achieve this in Angular? Should I use any specific library like moment-timezone or Intl.DateTimeFormat?

    Continue reading...

Compartilhe esta Página