dan3460
79
13
Laravel

Carbon Question really, making a only time stamp from a timestamp

Posted 1 year ago by dan3460

I have an array of time slots for a specific day of the week. In the other hand i have a timestamp for a specific date and time. The time slots are formated as "08:00", "08:15", etc. i can easily make them into a carbon time using Carbon::createFromFormat(), no problem there. So in order to compare the timestamp with my time slots, seems to me that i have to get the timestamp, convert it to string, extract the time and convert that back to a carbon date to make the comparison. I looked in the Carbon docs but could not find either been able to compare only times or directly create a carbon date from the time part of the timestamp. I hope this is not too confusing

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.