Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM Portals date issue - liquid rendering date in UTC

(0) ShareShare
ReportReport
Posted on by 480

Hi Everyone,

I am having an issue while retrieving a date field from CRM using Fetchxml and displaying it using web template in CRM Portals.

Date is CRM:

10/10/2018 00:00:00  (TimeZone UTC+10:00)

Liquid

{% assign PaidUntil=result['sa.cca_paiduntil'] | date: 'dd/MM/yyyy' %} 

{{PaidUntil}}  render the below:

09/10/2018

Actual value without formattting (retrieved in Portals)

{{result['sa.cca_paiduntil']}} 

09/10/2018 02:00:00 PM

Screenshot for more clarity below:

crmportalsdate.png

*This post is locked for comments

  • Verified answer
    Rizwan Aarif Profile Picture
    480 on at
    RE: CRM Portals date issue - liquid rendering date in UTC

    Thanks Nicholas,

    I managed it using moment like below:-

    I assigned {{serverdatevalue}} to a hidden field and then..

    var date = moment(hdnpaiduntil).format("YYYY-MM-DD");  

    var theTime = moment(hdnpaiduntil).format("HH:mm:ss");

    var stamp = date + "T" + theTime + "Z";

    var momentTime = moment(stamp);

    var datetimeAU= new Date(momentTime).toLocaleString('en-AU',{timeZone:'Australia/Brisbane'});

    var dateAU = datetimeAU.split(',');

    and retrieved it using first element dateAU[0]

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: CRM Portals date issue - liquid rendering date in UTC

    Hi Rizwan,

    Dynamics CRM basically converts the date as per your time zone when it's display. But actually it's save the datetime value in database by converting UTC. This is very confusing when you are accessing system with different timezone.The date will display as per your machine timezone.

    Now for your case if you don't need any datetime to save just make your field without time . You can change the field behavior by modifying the field.

    So just change the field behavior and select date only value.

  • Verified answer
    Nicholas Hayduk Profile Picture
    2,863 on at
    RE: CRM Portals date issue - liquid rendering date in UTC

    Hi Rizwan,

    Because the behavior of the field is User Local, the date you get is in UTC time, which is the 09/10/2018 02:00:00 PM you mention.  If you want to display in the user's browser timezone, I'd recommend using either https://momentjs.com/ or http://timeago.yarp.com/, both of which are included as libraries in Portals already.

    You could also use liquid filters if you wanted to provide a hard-coded offset from UTC:

    {{ result['sa.cca_paiduntil'] | date_add_hours: 10 }}

    Nick

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans