Base solution for your next web application
Open Closed

Wrong Notifications Time #7619


User avatar
0
mraad@fpnetworth created

Hello,

The user notifications are displayed in the wrong timezone.

For example: I publish a new notification right now using: _notificationPublisher.PublishAsync

The notificaiton is received and when I click to view my unread notifications, the time is displayed next to the notification as 3 hours ago.

We don't have any custom functionality. This all comes with the template.

I tried to trace the code and I see that it supports tenant timezones. We havent used that functionality and in this case, I read that moment by default uses the client timezone (which is what we want).

For example, the following notification was sent on 9:32 am Beirut Time. So it should be displayed as few minutes ago, when I directly view it from Beirut. I directly got 3 hours ago after opening it within a few minutes:

"{"tenantId":2,"notificationName":"App.LeaveRequest","data":{"type":"Abp.Notifications.MessageNotificationData","properties":{"Message":"This is a test message"}},"entityType":null,"entityTypeName":null,"entityId":null,"severity":1,"creationTime":"2019-09-09T03:32:35.803Z","id":"1f475e85-01e6-40e9-9bb1-3254c9d47e68"}"

The message shows it was saved as 3 hours earlier.

We're using ASPNETZero v7.0.0

Please advise.

Thanks.

Regards, Bilal.


5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team
    • What is your product type (Angular or MVC)?
    • What is the Clock.Provider for your application?
  • User Avatar
    0
    mraad@fpnetworth created

    Hello,

    We're using Angular and the default clock provider (UnspecifiedClockProvider).

    Regards, Bilal.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @mraad@fpnetworth

    Could you create an issue on https://github.com/aspnetzero/aspnet-zero-core/issues ? We will test and fix this problem.

    Thanks,

  • User Avatar
    0
    maliming created
    Support Team

    Hi @mraad@fpnetworth

    Why does the application backend return the creationTime with Z? UTC will have Z at the end of the time.

    "creationTime":"2019-09-09T03:32:35.803Z"
    
  • User Avatar
    0
    mraad@fpnetworth created

    Hello,

    It turned out that Azure by default uses UTC as the timezone regardless of the region.

    So i just changed Clock.Provider to UTC and all is good now.

    Thanks for your help.

    Regards, Bilal.