AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
addCalendar (Calendar calendar, int comp, int amount) yoix.util
 
NOTE: this function is deprecated and will be going away very, very soon. Use the add builtin of Calendar instead.

Adds amount to the component of calendar specified by comp. The Calendar argument is returned.
 
 Example:   addCalendar can be used to add and subtract as shown below:
import yoix.stdio.*;
import yoix.util.*;

Calendar c;

printf("Calendar is currently:\t\t\t%s\n", date(c.unixtime));

addCalendar(c, Calendar.MONTH, 15);

printf("Calendar after adding 15 months:\t%s\n", date(c.unixtime));

addCalendar(c, Calendar.DATE, -150);

printf("Calendar after subtracting 150 days:\t%s\n",
       date(c.unixtime));
with the result:
Calendar is currently:                  Tue Oct 17 20:18:11 EDT 2000
Calendar after adding 15 months:        Thu Jan 17 20:18:11 EST 2002
Calendar after subtracting 150 days:    Mon Aug 20 20:18:11 EDT 2001
 
 Return:   Calendar
 
 See Also:   Calendar, compareCalendar, date getCalendarLeastMaximum, getCalendarMaximum, getCalendarMinimum, getDateFormat, parseDate, rollCalendar, setCalendar

 

Yoix is a registered trademark of AT&T Inc.