How many days a deal has sat on a stage, how to put "May 15, 2026" into a contract instead of a machine date, when the nearest Friday for a mailing falls — the Bitrix24 workflow designer ships no ready-made actions for any of this. Four Roboteka robots cover the typical date operations: the difference between two dates in the unit you need, formatting for documents and emails, finding the nearest date by a condition, and determining the day of the week.
How do I calculate the difference between two dates?
Difference between two dates. Input: date 1, date 2 and the unit of measure — days, hours, minutes or months, days by default. There are three outputs: the signed difference — negative if the second date is earlier than the first; the absolute difference; and the number of full days, which is always returned regardless of the chosen unit. Examples: the age of an unpaid invoice in days for escalation; hours from lead creation to the first call for SLA control; months since the last purchase to trigger reactivation. Months are counted on the calendar grid — from January 31 to February 1 is exactly one month, ignoring the day. The sign of the difference is a ready-made "deadline passed / not yet" condition for a branch: write the number into a variable and compare it against a threshold.
How do I output a date in the "May 15, 2026" format?
In Bitrix24 fields a date is stored in machine form, but a contract needs the date written out. Date formatting accepts a date and a format: d.m.Y by default — 15.05.2026; D — "May 15, 2026"; Dlong — "May 15, 2026" with the year marker; Mnom and Mgen — the month name on its own in the nominative or genitive case; an arbitrary PHP date() format is supported too. There is one output — the formatted string; substitute it into a document template or email text where a machine date would look out of place. On input the robot understands YYYY-MM-DD, DD.MM.YYYY, a timestamp and a date with time — meaning the value of any "date" field can be passed without preparation.
How do I find the nearest Friday or the 1st of the month?
Nearest date by condition finds the nearest matching date from a starting date. Conditions: a weekday monday…sunday, first-day — the 1st of the next month, last-day — the last day of the current month, next-weekday — the nearest business day. The "include the date itself" flag (N by default) decides whether to count the starting date if it already matches: "next Friday" from a Friday is either today or a week from now. Outputs: the date in YYYY-MM-DD and DD.MM.YYYY formats and the number of days until it — use that to pause the process until the right moment. Examples: a weekly digest to a client on Fridays, moving a payment to the 1st of the month, reports on the last day of the month. If a recurring date must also be a business day, extend the chain with a production-calendar check.
How do I branch a process by the day of the week?
Day of week from date returns the day number — 1 for Monday, 7 for Sunday — the name in Russian and English, and a weekend flag (Y/N), which counts only Saturday and Sunday, with no public holidays. Combined with the Condition block this gives "Friday" logic: an enquiry created on Friday afternoon — the task is assigned for Monday, not "one day later" on Saturday. The day number is handy for comparisons like "greater than 5 means weekend"; the name is substituted directly into notifications — "we'll call back on Thursday" — with no manual lookup table mapping a number to a name.
What does a robot do with a non-standard date?
All four robots accept a date in the main forms that fields and Bitrix24 variables hand out: YYYY-MM-DD, DD.MM.YYYY, DD/MM/YYYY, a timestamp and variants with time. If the value cannot be parsed — the field held arbitrary text or was empty — the robot returns an empty or zero result and writes the reason to the log, without stopping the process. A practical trick: after the robot, add a condition on an empty result and a branch that notifies the responsible person — that way a data error surfaces immediately, not a month later in a report.
Bottom line
Date difference — Difference between two dates; the written-out format for documents — Date formatting; recurring dates — Nearest date by condition; day-based logic — Day of week from date. These robots are in the general category. No operation fits your task — describe it, we build the robot for free and add it to the catalog.