Decodes a datetime into a dynamic array of information about that datetime.

Info = SRP_DateTime("Decode", DateTime)

Returns

An @FM delimited array of information about the datetime. See Remarks.

Parameters

ParameterDescription
DatetimeA datetime in OI internal format. (REQUIRED)

Remarks

The "Decode" service breaks down an OI datetime into an @FM delimited array of information about the datetime. The structure of the returned array is as follows:

FieldDescriptionSee Also
<1>
The year component of the datetime.Year
<2>
The month component of the datetime. 1 - 12.Month
<3>
The day component of the datetime. 1 - 31.Day
<4>
The day of the year.DayOfYear
<5>
The day of the week. 1 = Monday, 7 = Sunday.DayOfWeek
<6>
The hour component of the datetime. 0 - 23.Hour
<7>
The minute component of the datetime. 0 - 59.Minute
<8>
The second component of the datetime. 0 - 59.Second

For example, if the OI datetime represents March 30, 1978 at 12:41:08pm, the result would be:

1978:@FM:3:@FM:30:@FM:89:@FM:4:@FM:12:@FM:41:@FM:8

Examples

// Decode the current datetime
Info = SRP_DateTime("Decode", DateTime())

// Decode the current UTC datetime
Info = SRP_DateTime("Decode", SRP_DateTime("Today", 1))

// Decode a hard coded datetime
Info = SRP_DateTime("Decode", -9519.67241898148)

// Decode a datetime that's formatted in a string
Datetime = SRP_DateTime("Parse", "Thursday, March 30, 1978 at 12:41:08pm", "DDD, MMMM D, YYYY at h:mm:sstt")
Info = SRP_DateTime("Decode", Datetime)
  • No labels