#1 2016-11-17 21:54:31

Kasito
Banned
Registered: 2016-08-05
Posts: 58

How do I check if a particular date then do something

Is there a way I can check if a current date equals 17/11/2016 then do this else do thing.   Any sample here will be appreciated.

Thanks.

Offline

#2 2016-11-17 22:06:34

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How do I check if a particular date then do something

Hello Kasito,

Take a look at the below code and post here any further question:

NewDate "" "" "[NowDate]"

NewDate "17/11/2016" "DD/MM/YYYY" "[FindedDate]"

// I want to improve this with a possibe new "DateIsEqual" action
DateIsSame "[NowDate]" "[FindedDate]" "day" "[DayIsSame]"
DateIsSame "[NowDate]" "[FindedDate]" "month" "[MonthIsSame]"
DateIsSame "[NowDate]" "[FindedDate]" "year" "[YearIsSame]"

IfEx "([DayIsSame] == 'true') && ([MonthIsSame] == 'true') && ([YearIsSame] == 'true')"
  AlertBox "Now and the finded date are the same date" "info"
Else
  AlertBox "Now and the finded date are NOT THE SAME date" "info"
EndIf

Offline

#3 2016-11-18 11:08:09

Kasito
Banned
Registered: 2016-08-05
Posts: 58

Re: How do I check if a particular date then do something

That is not what I meant.  See my example

If "NowDate" "==" "17/11/2016"
//do some action
Else
//do nothing
EndIf


How do I get the current date on a device and store in a Var, then do the comparison .

Last edited by Kasito (2016-11-18 11:09:59)

Offline

#4 2016-11-18 11:11:04

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How do I check if a particular date then do something

Hello Kasito,

Sorry, but I think the above code is exactly what you means... we get the "now" date and compare it with your provided one. Then we do something if the date is equal or other thing when not.

Maybe I am missunderstanding something?

Offline

#5 2016-11-18 23:07:26

Kasito
Banned
Registered: 2016-08-05
Posts: 58

Re: How do I check if a particular date then do something

Ok. Will try and get back to you. David

Offline

#6 2016-11-19 11:43:57

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How do I check if a particular date then do something

Hello,

Kasito wrote:

Ok. Will try and get back to you. David

Just post here if you have any further question Kasito.

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.