Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

udagg's avatar
Level 1

Recurring Task Daily, Weekly, Monthly, Quarterly

I am writing a code for my task application to add tasks that are repeated daily, weekly, monthly or quarterly. I have Start Date that will determine the day of the week/ day of month. I was wondering if I can do this using Carbon. Any help or references would be great.

0 likes
1 reply
SilenceBringer's avatar

@udit your question is not clear for me, but

If you want to compare today's date with the start_date of the task - for sure you can do it with Carbon. like (assuming start_date casted as date, so, is Carbon instance)

for day of week

today()->dayOfWeek == $task->start_date->dayOfWeek

or

today()->dayOfWeekIso == $task->start_date->dayOfWeekIso

for day of month

today()->day ==  $task->start_date->day

Please or to participate in this conversation.