web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Default DateTime

(0) ShareShare
ReportReport
Posted on by 235

Hello everyone,

I am writing an API, i need one more advice for the DateTime field,

I have in the request file:

[DataMember]
public DateTime DateofBirth { get; set; }

When i debug using the WCF Test Client there is the default date of today,

i need to set a different year.

The date format is 

request.DateOfBirth = string.Format("{0}-{1}-{2}",
DemographicsModification.DateOfBirth.GetValueOrDefault().Year.ToString(),
DemographicsModification.DateOfBirth.GetValueOrDefault().Month.ToString(),
DemographicsModification.DateOfBirth.GetValueOrDefault().Day.ToString()
);

How can I do?

Thank you!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    nghieppham Profile Picture
    4,755 on at

    Hi Devide,

    For working with Datetime, we need to consider about UTC time and Local time, depend on your way to get datetime, maybe you have to convert it to Local time. Please refer these link for more information

    technet.microsoft.com/.../dn946904.aspx

    www.powerobjects.com/.../crm-2011-truths-about-datetime

    Please share your code for checking.

    Regards,

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans