Skip to content

Commit e5aa440

Browse files
Add documentation week to sub and add function
1 parent 81c54c6 commit e5aa440

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Datium::createTimestamp( 1420057800 )->get() // output => 2015-01-01 00:00:00
126126
```
127127

128128
## Add Date
129-
This method allow you add some year, month, day, hour, minute and second to current date.
129+
This method allow you add some year, month, week, day, hour, minute and second to current date.
130130

131131
```js
132132
// If current date is 2016-01-01 00:00:00 then:
@@ -135,6 +135,10 @@ This method allow you add some year, month, day, hour, minute and second to curr
135135
Datium::now()->add('3 year')->get();
136136
// output => 2019-01-01 00:00:00
137137

138+
// Add 1 week
139+
Datium::create(2016, 1, 1)->add('1 week')->get();
140+
// output => 2016-01-08 00:00:00
141+
138142
// Add one month
139143
Datium::now()->add('1 month')->get()
140144
// output => 2016-02-01 00:00:00
@@ -162,6 +166,10 @@ Sub some year, month, day, hour, minute and second from current date.
162166
Datium::now()->sub('3 year')->get();
163167
// output => 2013-01-01 00:00:00
164168

169+
// Sub 1 week
170+
Datium::create(2016, 1, 8)->sub('1 week')->get();
171+
// output => 2016-01-01 00:00:00
172+
165173
// Sub one month
166174
Datium::now()->sub('1 month')->get()
167175
// output => 2015-12-01 00:00:00

0 commit comments

Comments
 (0)