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
inDaylightTime (TimeZone timezone, Number unixtime) yoix.util
 
If the time indicated by unixtime falls within the limits of daylight savings time for timezone, then a non-zero value is returned. Otherwise, zero is returned. This function duplicates the TimeZone built-in dst, which is the preferred method of obtaining DST information. Consequently, this function may be removed in a later release.
 
 Example:   In the following example, two dates are tested for occurring during a period of Eastern Daylight Savings Time.
import yoix.stdio.*;
import yoix.util.*;

double tm = 959832000;
TimeZone zone = getTimeZone("EST");

printf("%s is%s in daylight savings time\n",
       date(zone, tm), inDaylightTime(zone, tm) ? "" : " not" );
tm += 15814800.;
printf("%s is%s in daylight savings time\n",
       date(zone, tm), inDaylightTime(zone, tm) ? "" : " not" );
The results on standard output are:
Thu Jun  1  0:00:00 EDT 2000 is in daylight savings time
Fri Dec  1  0:00:00 EST 2000 is not in daylight savings time
 
 Return:   int
 
 See Also:   getTimeZone, getTimeZoneIDs, setTimeZone, TimeZone

 

Yoix is a registered trademark of AT&T Inc.