DateSetMinute

See Also: Time and Date Functions

Purpose

The DateSetMinute function returns a new DateTime value that is the original value, dtVar, with the minute component changed to iMinute.

Return Type

DateTime or TimeSpan

 

We recommend using the newer, higher level DateSet function to set a date and the DateAddXXX (DateAddDay, DateAddHour, DateAddMillisecond, DateAddMinute, DateAddMonth, DateAddSecond, DateAddYear) functions to manipulate DateTimes/Dates and the DateGetXXX (DateGetDay, DateGetHour, DateGetMillisecond, DateGetMinute, DateGetMonth, DateGetSecond, DateGetYear) functions to retrieve DateTimes/Dates.

The DateSetXXX (DateSetDay, DateSetHour, DateSetMillisecond, DateSetMinute, DateSetMonth, DateSetSecond, DateSetYear) functions have the following limitations:

Syntax

DateSetMinute( {dtVar}, {iMinute} )

Where:

Example

Procedure testDateSetMinute

    DateTime dtVar

 

    //Get the current local date and time

    Move (CurrentDateTime()) To dtVar

    Move (DateSetMinute(dtVar, 20)) To dtVar

 

    // This will print:

    // The Minute of 2/23/2005 9:20:09 AM is: 20

    Showln "The Minute of " dtVar " is: " (DateGetMinute(dtVar))

End_Procedure