PHP

DateTimeImmutable & Carbon

Në shqip përdoret i njëjti emër.

ShpjegimiSQ

DateTimeImmutable punon me data pa e ndryshuar objektin origjinal: $neser = $sot->modify('+1 day');. Laravel-i përdor Carbon, që shton metoda si diffForHumans() → „2 orë më parë“.

EnglishEN

DateTimeImmutable works with dates without changing the original object: $tomorrow = $today->modify('+1 day');. Laravel uses Carbon, which adds methods like diffForHumans() → “2 hours ago”.

Si ta mendosh

Si një kalendar ku çdo ndryshim krijon një faqe të re, pa fshirë të vjetrën.

Lexoje në anglisht

Like a calendar where each change makes a new page without erasing the old one.

Shembull kodiphp

$sot = new DateTimeImmutable();
$afati = $sot->modify('+7 days');
echo $afati->format('d.m.Y');

Terma të lidhur