Skip to main content

SecondOfTheMinute

Function SecondOfTheMinute( const AValue : TDateTime) : Word

Example

procedure ScriptEvent(var Value: variant);
var
InputValue: TDateTime;
begin
InputValue := EncodeDateTime(2026, 7, 16, 13, 5, 7, 900);
Value := SecondOfTheMinute(InputValue); // 7
end;

Usage

SecondOfTheMinute returns the second-within-minute component as an exact alias of SecondOf.

Parameters

NameTypeDescription
AValueTDateTime, constEncoded date/time whose second field is required.

Returns

A Word from 0 through 59.

Behaviour

  • Results are identical to SecondOf for every valid input.
  • Milliseconds are discarded rather than rounded.
  • Date, hour and minute fields do not change the returned component.
  • No timezone or locale processing occurs.

Errors

Invalid encoded date/time input can raise an error.

Usage notes

Prefer whichever name makes the script clearest; there is no semantic difference between this function and SecondOf.

Additional Technical Info

SecondOfTheMinute returns the second-within-minute field. In the installed Delphi implementation it is an exact alias of SecondOf.

The example is fictional, deterministic and source-reviewed. It was not executed by the documentation workflow.

Implementation

The DateUtils import binds to System.DateUtils.SecondOfTheMinute. That function immediately returns SecondOf(AValue), which decodes the time and selects the second field.

Edge cases and quirks

  • The name describes the component boundary; it does not calculate elapsed seconds.
  • Leap seconds are unsupported.
  • Decode failures propagate.
  • Free Pascal provides the same-name routine with the same component meaning.

Side effects

None.

Performance and concurrency

Constant-time alias call and decode with no shared state.

Related entries

External references

Created 2026-07-15