How to programmatically set the date and time of the Publish field of Publishing section in Sitecore -
xmlnode jobpostdate = xmldocumentobject.selectsinglenode("msgdata/hrs_jo_pst_opn_dt) var jpdate = jobpostdate.innertext; datetime dt1 = convert.todatetime(jpdate); var hrs_jo_pst_opn_dt = dt1; newitem.fields[sitecore.fieldids.publishdate].value = hrs_jo_pst_opn_dt.tostring();
i using above code date (01/09/2013) , set publish field, getting '1/1/0001' values, shown in below picture, in field.
please advise doing wrong.
try set value of date field:
newitem.publishing.publishdate = dt1;
use publishing.unpublishdate
property set unpublish date
Comments
Post a Comment