Home Contents | # datetime:isdst | Date/Time | Core4 Lua Commands

## SYNOPSIS

1. flag = datetime:isdst()
2. seconds = datetime:offset()
3. name = datetime:zone()

## DESCRIPTION

Assuming that datetime contains local date/time, these functions are used to query information about the stored value.

## RETURN VALUE

datetime:isdst() returns a boolean, indicating whether the stored date/time lies within a range where daylight saving rules are in effect.

datetime:offset() returns the offset of the stored local time to UTC, taking daylight saving rules into account.

datetime:zone() returns the name of the time zone of the stored value, which might differ depending if daylight saving is in effect or not (e.g. CET vs. CEST).

## ERRORS

Raises an error if datetime is not a datetime instance.

All functions return nil if datetime is not a local date/time.

## EXAMPLE

> >
dt = clock.currentDateTime():toLocal() print (dt, dt:isdst(), dt:offset(), dt:zone())
2009-08-06T13:07:14 true 7200 CEST

## SEE ALSO

clock.currentDateTime, clock.newDateTime, clock.setDateTime, clock.tzget, clock.tzset, datetime(), datetime:addDays, datetime:addMonths, datetime:addSecs, datetime:addYears, datetime:base90, datetime:date, datetime:day, datetime:daysTo, datetime:format, datetime:hour, datetime:isNull, datetime:isValid, datetime:minute, datetime:month, datetime:msec, datetime:second, datetime:secsTo, datetime:set, datetime:setBase90, datetime:time, datetime:toLocal, datetime:toUTC, datetime:year, tostring(datetime)