How to format a datetime column using client timezone
How to format a datetime column using client timezone

Hello, I have a database table that has a datetime column that stores date and time using UTC. I need to show that date and time using client tomezone.
If I use render: $.fn.dataTable.render.moment('', 'DD/MM/YYYY HH:mm:ss')
datetime appears in UTC timezone.
I cannot do conversion in server side, because server has in a different timezone than clients.
Any help, please?
Thanks
Jaime
This discussion has been closed.
Answers
Take a look at this please: https://stackoverflow.com/questions/10087819/convert-date-to-another-timezone-in-javascript
Look for moment-timezone
You need to change the date-time value BEFORE it is being rendered using $.fn.dataTable.render.moment.
Thanks, but I could not use
$.fn.dataTable.render.moment
.Finally I have used:
Glad you got it working! Many roads lead to Rome!
And thanks for posting your solution. I do date rendering server side and it is CET (central european time) only which won't work if we expand beyond that time zone (which is pretty big though ...).