Digging Deeper
Carbon
Introduction
JCC Express MVC provides a fluent date/time utility through the Carbon class, inspired by Laravel's Carbon and backed by date-fns.
TypeScript
Creating instances
TypeScript
Formatting
TypeScript
Addition
TypeScript
All addition methods return this and are chainable:
TypeScript
Subtraction
TypeScript
Start / End of period
TypeScript
Comparison
TypeScript
Differences
TypeScript
Getters
TypeScript
Setters
TypeScript
setTimezone accepts any IANA timezone identifier. The underlying moment in time is unchanged; getters return values in the specified timezone.
Cloning and conversion
TypeScript
Static utilities
TypeScript
Summary
- Import
Carbonfromjcc-express-mvc/Core/Date. - All mutation methods return
thisfor chaining. - Use
clone()before mutating if you need to preserve the original. getMonth()returns 0–11; usemonth()for the 1–12 variant.diffForHumans()produces human-readable relative strings like "3 days ago".