出於某種原因,我的代碼無法正常工作,它可能位於contacthours.Hours1From
和contacthours.Hours1To
部件上。DateTime.ParseExact無法正常工作
ExtendedContactDetailsType contactdetails = new ExtendedContactDetailsType();
contactdetails.ClassifiedAdContactByEmailEnabled = true;
ContactHoursDetailsType contacthours = new ContactHoursDetailsType();
contacthours.Hours1AnyTime = false;
contacthours.Hours1Days = DaysCodeType.Weekdays;
contacthours.Hours1From = DateTime.ParseExact("08:00", "hh:mm", null);
contacthours.Hours1To = DateTime.ParseExact("16:00", "hh:mm", null);
contacthours.TimeZoneID = "Eastern";
contactdetails.ContactHoursDetails = contacthours;
item.ExtendedSellerContactDetails = contactdetails;
你的意思是「工作不正常」你面臨的問題是什麼?預期的行爲是什麼? – Shyju
我們無法猜測「不工作」是什麼意思。 –
簡單的解決方案 - 使用調試器,進入你的代碼並檢查'contacthours.Hours1From'和'contacthours.Hours2From'的值,並確保它們可以解析爲'DateTime'。它最有可能比等待別人抓住他們的SO水晶球更快...... – Tim