Export (0) Print
Expand All

DateTime

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

A DateTime field can be formatted to show both the date and time, or the date only. The following properties are available:

DateTime propertiesTypeDescription
{Field}.DataValueDate or NullGet/set property.

The original value is left unchanged if the new value cannot be parsed.

{Field}.TimeVisibleBoolean Get property.

This property specifies if the time is to be shown.


Example

The following code example shows how to use a field of type DateTime.

var oDate;
var oToday;

oDate =  crmForm.all.scheduledend.DataValue;
if (oDate == null) {
    oDate = new Date();
}

oToday = new Date();
oDate = oToday;
oDate = oDate.setHours(17,0,0);

if (oDate.TimeVisible)
{
   alert("The time is visible.");
}
else
{
   alert("Only the date is visible; the time is hidden.");
}

crmForm.all.scheduledend.DataValue = oDate;

See Also

Concepts

Other Resources


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft