Date Format

Description

The DateFormat operation allows building a date string from parts in the Date structure

URI

REST URI [GET]:
/v11.02/Date.svc/Format?SessionId={sessionId}&DateType={dateType}&RequestedDate={requestedDate}&StandardizedDate={standardizedDate}&JulianDay={julianDay}&Day={day}&Month={month}&Year={year}&BC={BC}&RangeBeginDay={rangeBeginDay}&RangeBeginMonth={rangeBeginMonth}&RangeBeginYear={rangeBeginYear}&RangeBeginBC={rangeBeginBC}&RangeEndDay={rangeEndDay}&RangeEndMonth={rangeEndMonth}&RangeEndYear={rangeEndYear}&RangeEndBC={rangeEndBC}

Example

Request GET
http://wsdev.onegreatfamily.com/v11.02/Date.svc/Format?SessionId=113434515134543151134&DateType=DATE_RANGE_BETWEEN&BC=false&Day=0&JulianDay=0&Month=0&RangeBeginBC=true&RangeBeginDay=21&RangeBeginMonth=5&RangeBeginYear=2004
&RangeEndBC=true&RangeEndDay=31&RangeEndMonth=5&RangeEndYear=2004&RequestedDate=s&StandardizedDate=s&Year=0
Success Response Payload
<Result xmlns="http://schemas.datacontract.org/2004/07/OGF.WS.Data" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
	<Code>0</Code>
	<Message>Success</Message>
	<Value i:type="a:string" xmlns:a="http://www.w3.org/2001/XMLSchema">BET 21 MAY 2004 B.C. AND 31 MAY 2004 B.C.</Value>
</Result>
Failed Response Payload
<Result xmlns="http://schemas.datacontract.org/2004/07/OGF.WS.Data">
	<Code>27001</Code>
	<Message>Your developer Id does not have permissions to make this call</Message>
</Result>
Fault Response Payload
<RestFault xmlns="http://schemas.datacontract.org/2004/07/OGF.WS.Data">
	<ErrorCode>551</ErrorCode>
	<FaultMessage>An unhandled exception has occurred</FaultMessage>
</RestFault>

Query String Parameters

Name Description Required

DateType

OneGreatFamily the date type

Type: DateType

Constraints: None

Yes

RequestedDate

The date (not standardized)

Type: String

Constraints: None

No

StandardizedDate

The date in standard format

Type: String

Constraints: None

No

JulianDay

The date as a julian date

Type: uint

Constraints: None

No

Day

The Day

Type: uint

Constraints: Must be a valid day within the month

No

Month

The month

Type: uint

Constraints: Must be a valid month

No

Year

The Year

Type: uint

Constraints: valid number representing a year

No

BC

True if the date is BC

Type: bool

Constraints: None

No

RangeBeginDay

The beginning day of date range

Type: uint

Constraints: Must be a valid day within the month

No

RangeBeginMonth

The beginning month of a range

Type: uint

Constraints: Must be a valid month

No

RangeBeginYear

The beginning year

Type: uint

Constraints: valid number representing a year

No

RangeBeginBC

True if the date is BC

Type: bool

Constraints: None

No

RangeEndDay

The End day of date range

Type: uint

Constraints: Must be a valid day within the month

No

RangeEndMonth

The beginning month of a range.

Type: uint

Constraints: Must be a valid month

No

RangeEndYear

The range end year

Type: uint

Constraints: valid number representing a year

No

RangeEndBC

true if the date is BC

Type: bool

Constraints: None

No

SessionId

The current session Id

Type: string

Default: None

Yes

Response Elements

Name Description

Result

This operation returns a Result Entity

Type: Result

Result.Value

Result.Value will be a standardized date as a string on success

Type: String

HTTP Status Code

The Web Server returns a status code which indicates if the operation was successful. Anything other than 200 should be regarded as a failure.

HTTP Status Code of 417

The Web Server threw an exception and contains a RestFault entity. Retrieve the RestFault from the Webexception response property.