Supported Date/Time Formats

SBM uses the ICU (International Components for Unicode) library (version 3.6) for dateTime support. The SBM Date/Time field values are strings and must be in XML dateTime format. The value is expected to be in coordinated universal time (UTC). Below are four examples of dateTime strings that you can send to the SBM Web services:

#

Example

Explanation

1

2006-04-28

No offset from 00:00:00, April 28, 2006

or

2006-04-28T00:00:00+00:00

2

2006-04-28T13:20-6:00

6-hour offset from 1:20:00 p.m., April 28, 2006

or

2006-04-28T19:20:00+00:00

3

2006-04-28T19:20:30+0:00

No offset from 7:20:30 p.m., April 28, 2006

4

2006-04-28T13:20:30.45-6:00

6-hour offset from 1:20:30 p.m., April 28, 2006

or

2006-04-28T19:20:30+00:00

If you use the format shown in example 1, the SBM Web services return Date Only field values in the same format. If you use the formats shown in examples 2, 3, or 4, the SBM Web services return Date/Time field values in the same format as example 3.
Note: SBM does not currently store the fractions of a second when the format in example four is used.

Web service dateTime values that are sent with milliseconds must be 29 characters in length. For example, 2006-04-28T13:20:30.45-6:00 results in an invalid value response; however, 2006-04-28T13:20:30.450-06:00 is accepted. Therefore, specify the value with milliseconds in exactly 29 characters or remove the milliseconds from the value (2006-04-28T13:20:30-6:00).

The SBM Web services API has two special system Date/Time fields, item.createDate and item.modifiedDate, which have values in seconds since January 1, 1970 (Unix time). These fields are automatically populated by SBM and it is recommended that you do not modify them. SOAP will convert these values to its dateTime format for transport in XML.

You can explicitly set these values as shown in the following C# example code:

string MyString = "Jan 1, 2006 12:12:12 am";

DateTime MyDateTime = DateTime.Parse(MyString);

web.TTItem item = new web.TTItem();

item.createDate = MyDateTime;

item.modifiedDate = MyDateTime;