You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-@param {**number**} years - Number of years to add
438
-
-@param {**boolean**} [utc] - Calculates as UTC `Added in: v3.0.0`
439
-
-@returns {**Date**} The Date object after adding the value
438
+
-@param {**number**} years - The number of years to add
439
+
-@param {**boolean**} [utc] - If true, calculates the date in UTC `Added in: v3.0.0`
440
+
-@returns {**Date**} The Date object after adding the specified number of years
440
441
441
-
Adds years to the date object.
442
+
Adds years to a date object. Subtraction is also possible by specifying a negative value. If the third parameter is false or omitted, this function calculates based on the system's default time zone. If you need to obtain calculation results based on a specific time zone regardless of the execution system, consider using the `addYearsTZ()`, which allows you to specify a time zone name as the third parameter. See [PLUGINS.md](./PLUGINS.md) for details.
-@param {**number**} months - Number of months to add
460
-
-@param {**boolean**} [utc] - Calculates as UTC `Added in: v3.0.0`
461
-
-@returns {**Date**} The Date object after adding the value
460
+
-@param {**number**} months - The number of months to add
461
+
-@param {**boolean**} [utc] - If true, calculates the date in UTC `Added in: v3.0.0`
462
+
-@returns {**Date**} The Date object after adding the specified number of months
462
463
463
-
Adds months to the date object.
464
+
Adds months to a date object. Subtraction is also possible by specifying a negative value. If the third parameter is false or omitted, this function calculates based on the system's default time zone. If you need to obtain calculation results based on a specific time zone regardless of the execution system, consider using the `addMonthsTZ()`, which allows you to specify a time zone name as the third parameter. See [PLUGINS.md](./PLUGINS.md) for details.
-@param {**boolean**} [utc] - Calculates as UTC `Added in: v3.0.0`
483
-
-@returns {**Date**} The Date object after adding the value
482
+
-@param {**number**} days - The number of days to add
483
+
-@param {**boolean**} [utc] - If true, calculates the date in UTC `Added in: v3.0.0`
484
+
-@returns {**Date**} The Date object after adding the specified number of days
485
+
486
+
Adds days to a date object. Subtraction is also possible by specifying a negative value. If the third parameter is false or omitted, this function calculates based on the system's default time zone. If you need to obtain calculation results based on a specific time zone regardless of the execution system, consider using the `addDaysTZ()`, which allows you to specify a time zone name as the third parameter. See [PLUGINS.md](./PLUGINS.md) for details.
484
487
485
488
```javascript
486
489
constnow=newDate();
487
490
constyesterday=date.addDays(now, -1);
488
491
```
489
492
490
-
### addHours(dateObj, hours[, utc])
493
+
### addHours(dateObj, hours)
491
494
492
495
-@param {**Date**} dateObj - A Date object
493
-
-@param {**number**} hours - Number of hours to add
494
-
-@param {**boolean**} [utc] - Calculates as UTC `Added in: v3.0.0`
495
-
-@returns {**Date**} The Date object after adding the value
496
+
-@param {**number**} hours - The number of hours to add
497
+
-~~@param {**boolean**} [utc] - If true, calculates the date in UTC `Added in: v3.0.0`~~`Removed in: v3.5.0`
498
+
-@returns {**Date**} The Date object after adding the specified number of hours
499
+
500
+
Adds hours to a date object. Subtraction is also possible by specifying a negative value. The third parameter was deprecated in version 3.5.0. Regardless of what is specified for this parameter, the calculation results will not change.
496
501
497
502
```javascript
498
503
constnow=newDate();
499
504
constan_hour_ago=date.addHours(now, -1);
500
505
```
501
506
502
-
### addMinutes(dateObj, minutes[, utc])
507
+
### addMinutes(dateObj, minutes)
503
508
504
509
-@param {**Date**} dateObj - A Date object
505
-
-@param {**number**} minutes - Number of minutes to add
506
-
-@param {**boolean**} [utc] - Calculates as UTC `Added in: v3.0.0`
507
-
-@returns {**Date**} The Date object after adding the value
510
+
-@param {**number**} minutes - The number of minutes to add
511
+
-~~@param {**boolean**} [utc] - If true, calculates the date in UTC `Added in: v3.0.0`~~`Removed in: v3.5.0`
512
+
-@returns {**Date**} The Date object after adding the specified number of minutes
513
+
514
+
Adds minutes to a date object. Subtraction is also possible by specifying a negative value. The third parameter was deprecated in version 3.5.0. Regardless of what is specified for this parameter, the calculation results will not change.
508
515
509
516
```javascript
510
517
constnow=newDate();
511
518
consttwo_minutes_later=date.addMinutes(now, 2);
512
519
```
513
520
514
-
### addSeconds(dateObj, seconds[, utc])
521
+
### addSeconds(dateObj, seconds)
515
522
516
523
-@param {**Date**} dateObj - A Date object
517
-
-@param {**number**} seconds - Number of seconds to add
518
-
-@param {**boolean**} [utc] - Calculates as UTC `Added in: v3.0.0`
519
-
-@returns {**Date**} The Date object after adding the value
524
+
-@param {**number**} seconds - The number of seconds to add
525
+
-~~@param {**boolean**} [utc] - If true, calculates the date in UTC `Added in: v3.0.0`~~`Removed in: v3.5.0`
526
+
-@returns {**Date**} The Date object after adding the specified number of seconds
527
+
528
+
Adds seconds to a date object. Subtraction is also possible by specifying a negative value. The third parameter was deprecated in version 3.5.0. Regardless of what is specified for this parameter, the calculation results will not change.
520
529
521
530
```javascript
522
531
constnow=newDate();
523
532
constthree_seconds_ago=date.addSeconds(now, -3);
524
533
```
525
534
526
-
### addMilliseconds(dateObj, milliseconds[, utc])
535
+
### addMilliseconds(dateObj, milliseconds)
527
536
528
537
-@param {**Date**} dateObj - A Date object
529
-
-@param {**number**} milliseconds - Number of milliseconds to add
530
-
-@param {**boolean**} [utc] - Calculates as UTC `Added in: v3.0.0`
531
-
-@returns {**Date**} The Date object after adding the value
538
+
-@param {**number**} milliseconds - The number of milliseconds to add
539
+
-~~@param {**boolean**} [utc] - If true, calculates the date in UTC `Added in: v3.0.0`~~`Removed in: v3.5.0`
540
+
-@returns {**Date**} The Date object after adding the specified number of milliseconds
541
+
542
+
Adds milliseconds to a date object. Subtraction is also possible by specifying a negative value. The third parameter was deprecated in version 3.5.0. Regardless of what is specified for this parameter, the calculation results will not change.
0 commit comments