Hello, I have a formula below, which calculates daylight savings time automatically.
It calculates if the current date falls between second sunday of march and first sunday of novemeber.
Scenario:
A formula text field called "Is it daylight savings time" contains below mentioned formula:
var date firstdayofmarch = Date(Year(ToDate([Created or Now])),3,1);
var date secondsunday=LastDayOfWeek((LastDayOfWeek($firstdayofmarch)+Days(1)))+Days(1);
var date firstdayofnovember = Date(Year(ToDate([Created or Now])),11,1);
var date firstsundayofnovember = LastDayOfWeek($firstdayofnovember)+Days(1);
If (ToDate([Created or Now]) >= $secondsunday and ToDate([Created or Now])< $firstsundayofnovember
,"Yes"
,"No"
)
This is resulting in a "No", can anyone let me know why is not calculating in the right way?
Create or Now field returns the current date.
#formula
------------------------------
Raj Helaiya
------------------------------
Question
Calculate Daylight Savings time
Sign up
Already have an account? Login
Login to the community
Login with Quickbase US – quickbase.com Login with Quickbase EU – quickbase.eu
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.