[data grid] dateTime column how to show date/time for another timezone #11804
Labels
component: data grid
This is the name of the generic UI component, not the React module!
external dependency
Blocked by external dependency, we can’t do anything about it
support: commercial
Support request from paid users
The problem in depth
I need to display the date and time returned from the server in a certain timezone (in the datagrid column with 'dateTime' type).
The date I receive is in UTC (e.g
2024-01-24T11:52:12
). Let's say I want to convert this date toAmerica/Bogota
timezone (UTC -5), so that the datagrid displays 24/01/2024 06:52AMI'm converting the date to the desired timezone like this
The only problem I encounter is that converting the dayjs string to JS
Date
object automatically adds the client's UTC offset. So far I have not managed to find a way around it.Your environment
`npx @mui/envinfo`
Search keywords: datagrid datetime
Order ID: 67193
The text was updated successfully, but these errors were encountered: