
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)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,