Documentation > Services API > ServicesPostInput > SetDateTime(PanelEntry,String,Boolean)

SetDateTime

Accepts an asset and a fieldname, overloads for panel entry and panel entry fieldname looks for showdatetime fields in input form and saves them to a consolodated field with the name fieldname. Saves the fields in a consolodated datetime field that can be used in output and for sorting in filter and file lists This override is used by panelEntrys. Load and iterate through panels in the input form before calling.

public System.Void SetDateTime(PanelEntry,String,Boolean)

Parameters

NameDescriptionType
panelEntry PanelEntry that contains the field generated by ServicesInput.ShowDateTime() CrownPeak.CMSAPI.PanelEntry
fieldName Field name that was used for ServicesInput.ShowDateTime() System.String
convertToUTC If true, converts from user time to UTC for parity with VB's showSelectGMT System.Boolean

Code Example

C#

Sample:

            
            List<PanelEntry> panels = asset.GetPanels("Articles");
            foreach (PanelEntry entry in panels)
            {
              ServicesPostInput.SetDateTime(entry, "Date_Time");
            }
            
            

Connect with Crownpeak