/round-time

This node is designed for rounding times based on user-defined rules. It accepts various parameters to tailor the rounding process, such as the direction and degree of rounding. This service is useful for applications requiring standardized or adjusted time records, like logging, scheduling, or time tracking systems.

Rounding time is invaluable in several sectors beyond workforce management. In transportation, for instance, rounding departure and arrival times to the nearest 5 or 10 minutes can streamline schedules and improve readability for passengers. This can lead to better time management and customer satisfaction, as passengers have a clearer understanding of transit timings.

In healthcare, rounding times in patient care records can help maintain consistent entry formats, making it easier for medical professionals to review and analyze records quickly. This practice is particularly useful during shift changes when nurses or doctors need to assess patient status updates efficiently.

In the field of project management, rounding time can help in logging project tasks where exact start and end times might not be crucial, but the total time spent is. Rounding to the nearest quarter-hour, for example, can simplify invoicing and progress tracking, ensuring that billing is straightforward and that clients have a clear summary of time invested in various tasks.

Furthermore, in educational settings, rounding class start and end times to standard intervals can facilitate timetable creation, ensuring that class schedules are easy to memorize and align with standardized periods, thereby minimizing confusion for students and teachers alike.

Overall, time rounding finds its utility in any domain where time tracking simplifies processes, enhances clarity, or improves alignment with organizational policies and regulations.

HTTP Method

POST

Request URL

https://node.nodetrigger.com/round-time

Request Body (JSON)

  • date: The date or time string to be rounded (required).
  • format: The format of the date string, indicating how the input should be parsed (required).
  • round: The increment in minutes to which the time should be rounded (e.g., 5, 10, 15) (required).
  • direction: The direction of rounding (‘up’ or ‘down’) (required).
  • customRound: An optional integer indicating custom rounding rules; positive for rounding up and negative for rounding down.

Response

The response will include the original date, its formatted split version, the original hour, and the rounded times according to specified increments or custom rules if provided.

Notes

Format specified in the JSON object is case-sensitive. In date and time formatting, uppercase and lowercase letters often represent different components of the date and time. For instance, in the provided format "YYYY-MM-DD HH:mm":

  • YYYY indicates a four-digit year.
  • MM represents the two-digit month.
  • DD is the two-digit day of the month.
  • HH is the two-digit hour in a 24-hour format.
  • mm stands for two-digit minutes.

Examples

Example 1: Round Time Up by 5 Minutes

Request

{
  "date": "13:06",
  "format": "HH:mm",
  "round": 5,
  "direction": "up"
}

Curl Command

curl -X POST https://node.nodetrigger.com/round-time \
-H "Content-Type: application/json" \
-d '{"date": "13:06", "format": "HH:mm", "round": 5, "direction": "up"}'

Example 2: Round Time Down by 10 Minutes with Custom Rounding

Request

{
  "date": "2022-06-24 15:17",
  "format": "YYYY-MM-DD HH:mm",
  "round": 10,
  "direction": "down",
  "customRound": -15
}

Curl Command

curl -X POST https://node.nodetrigger.com/round-time \
-H "Content-Type: application/json" \
-d '{"date": "2022-06-24 15:17", "format": "YYYY-MM-DD HH:mm", "round": 10, "direction": "down", "customRound": -15}'