minute(now()) /* Output: 25 (When current time was 11:25 AM) */ /* Assume a property called Date with a current date of June 24, 2022 11:29 AM */ prop("Date").minute() /* Output: 29 */
minute() can be used with other functions such as dateSubtract to change the value of a date, like so:
/* Assume the value of now() is June 24, 2022 11:34 AM */ now().dateSubtract(now().minute(), "minutes") /* Output: June 24, 2022 11:00 AM */
This example database shows both the current time (using the now function), as well as the current time rounded to the nearest hour.
let( minute, now().minute(), if( minute < 30, dateSubtract( now(), minute, "minutes" ), dateAdd( now(), 60 - minute, "minutes" ) ) ) /* Explained */ let( /* First, get the minute value of now() and set it as a minute variable */ minute, now().minute(), if( /* Check if the minute value is less than 30 */ minute < 30, /* If so, subtract the minute value from now() to get the current hour */ dateSubtract( now(), minute, "minutes" ), /* If not, add the minute value to now() to get the next hour */ dateAdd( now(), 60 - minute, "minutes" ) ) )