i need add time conversion from utc to local time(Ist)
*This post is locked for comments
i need add time conversion from utc to local time(Ist)
*This post is locked for comments
Also, to let you know, while storing the date time field value using JavaScript, no conversion is needed. CRM stores all date time values in UTC and when we show on the form, CRM automatically converts the field value to user's timezone based on the user's personal setting. The only problem developers face is when we try to retrieve the datetime field value using code. So in that case, you should first fetch the timezone set for logged user and then convert the datetime field value.
Hi Sandeep,
Can you please tell me the exact scenario you are trying, so that I can check if I can help you. Also, can you please let me know the CRM version you are using?
Also, do you need time part in the date you are using or your business logic is based on Date only? If you are using CRM 2016 environment, then please look into below link. It might help you.
technet.microsoft.com/.../dn946904.aspx
Thanks & Regards,
Yadnyesh Kuvalekar
Tick verify answer if this resolves your query.
@Yadnyesh Kuvalekar can you provide some help
the answers i am getting from experts like you and others are more better than microsoft as when i raise a ticket most of the time they say coding part we can't help you customization we can help you..
if its still not happening, raise a ticket to microsoft and they might help you.
time zone is in GMT us and canada.. and it should be not changed as many users have same time zone selected. due date should be in IST and i still did not get solution for this
Hi Sandeep
Go to Options (Wheel Icon) on top right corner>>General Tab>>Set your timezone to CST or GMt-5...this is calle dpersonal option settings
Timezone settings must be same for all users, if there is just one geographic location.
Go to settings>.Administrations>>System Settings>>General Tab>>choose timezone
All users must have same time zone in their personal options as they have in system settings
var dueDate = Xrm.Page.data.entity.attributes.get("createdon");
var now = new Date();
var endDate = new Date().setDate(now.getDate()+30);
alert("one");
utc = now.getTime + (now.getTimezoneOffset() * 60000);
alert(utc);
var d = new Date(utc + (3600000*offset));
var a = d.toLocaleString();
alert(a);
i sthis correct code? or any changes need to be done
?
here time is not related to due date i think , its just showing the present time after 20 mins if i refresh page again it showing that time.. if its 5:30 now if i refresh page on 6pm its showing 6pm time.only date is populating time is not at all behaving
due date is date and field i think there is 10:30 hrs difference so y the time not updating and only date is updating.. i am adding many codes still not updating,
André Arnaud de Cal...
293,043
Super User 2025 Season 1
Martin Dráb
231,864
Most Valuable Professional
nmaenpaa
101,156
Moderator