Search code examples
kentico

Kentico DateTime WebPart not working with Custom TimeZone


I have setup kentico 11 I want to show time difference from my local time. I have used DateTime Webpart but time still get from my local time. My configure in WebPart.

Example: I live at Cambodia and I want to display time at "Abu Dhabi, Muscat".

Date and time format: HH:MM TT, mmmm dd , yyyy
Time zone: Custom
Custom time zone: (UTC+04.00) Abu Dhabi, Muscat

I would appreciate any help fix issue.

Thank you in advance!!


Solution

  • Now I got resolve my problem

    {% String.FormatString("{0:hh:mm tt, MMMM d, yyyy}", DateTime.UtcNow.AddHours(4)) #%}