Moment
Sometimes you need to manage date. That's why we developed Moment. Moment allows you to manage dates simply.
Basic Usage
First you need to initialize Moment using the moment
function:
Here:
$today
equals to todaytimestamps
$yesterday
equals to yesterdaytimestamps
$tomorrow
equals to tomorrowtimestamps
If you don't pass a day as argument to the moment
function, the today timestamps will be returned.
Adding date
Since you have initialized a moment, you can add value to this moment using the add
function. Here is an example:
Removing date
You can also remove value to the current date with the remove
function:
Getting Timestamps Value
If you want to get the timestamps value of an moment, use the timestamp
function:
Formatting
You can get a formatted date of an moment using the format
function:
Dernière mise à jour
Cet article vous a-t-il été utile ?