Salesforce

How Do I Calculate the Hour/Minute/Seconds Portion of a Given Time Value? (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

How Do I Calculate the Hour/Minute/Seconds Portion of a Given Time Value? (Magic xpa 4.x)

When you need to work with the hour, minute, or seconds portion of a time, you can calculate the values by doing some arithmetic. However, there are some good functions to make the process a lot easier. Using the Hour(), Minute(), and Second() functions will easily return those parts of time field.

The Time Functions

  • Hour(time) returns the hour portion of the time, as a number.

  • Minute(time) returns the minute portion of the time, as a number.

  • Second(time) returns the seconds portion of the time, as a number.

Where time is any time variable (or a hard-coded time, such as '16:10:14'TIME, or an expression that evaluates to a time).

Hint: If you need milliseconds, you need to use the mTime() function.

See also

The Online and Rich Client Samples projects (program DT15 and RDT15)

Reference
Attachment 
Attachment