Hi,
how is it possible to check today is in range of StartDate and EndDate which is expressed by wildcards.
example:
StartDate: [20*] which is the same as ([20.*], [20.*.*], [20.##.####] ...)
EndDate: [30*]
Today: 27.10.2015 and from 20 to 30 of each month should return valid.
or
StartDate: [18:00]
EnDate: [09:00]
get invalid from 09:00 to 18:00
it is possible to check today against StartDate and EndDate mask but not range.
is there any way to validate date without decompositing datemask to valid format and generating range of days?
ThanQ much
Check if date in range of startdate and enddate [SOLVED]
Check if date in range of startdate and enddate [SOLVED]
Last edited by LiK137 on Tue Jan 10, 2017 10:45 am, edited 1 time in total.
- RSBasic
- Moderator

- Posts: 1228
- Joined: Thu Dec 31, 2009 11:05 pm
- Location: Gernsbach (Germany)
- Contact:
Re: Check if date [today,now] in range of startdate and endd
Do you mean so?
Code: Select all
EnableExplicit
Define CurrentDateTime = Date()
Define StartDateTime = Date(2015, 10, 26, 0, 0, 0)
Define EndDateTime = Date(2015, 10, 28, 23, 59, 59)
If CurrentDateTime >= StartDateTime And CurrentDateTime <= EndDateTime
Debug "Yes"
Else
Debug "No"
EndIfRe: Check if date [today,now] in range of startdate and endd
ThanQ for reply but this is not what I mean.
the idea to check if Today is in range of [%date1,%date2]
assume that:
date1=13:00 -> Any day of the year from 13:00
date2=14:00 -> Any day of the year to 14:00
instead of 13:00 can be input 13:* but date2 which is enddate or stopdate can not be 14:* because startdate equal to 13:00 means from 13:00 and enddate equal to 14:00 means exactly at 14:00.
If enddate input as 14:* which means up to 14:59
My goal is to validate date using WILDCARDS (* - any chars, ? - single char, # - single digit)
the idea to check if Today is in range of [%date1,%date2]
assume that:
date1=13:00 -> Any day of the year from 13:00
date2=14:00 -> Any day of the year to 14:00
instead of 13:00 can be input 13:* but date2 which is enddate or stopdate can not be 14:* because startdate equal to 13:00 means from 13:00 and enddate equal to 14:00 means exactly at 14:00.
If enddate input as 14:* which means up to 14:59
My goal is to validate date using WILDCARDS (* - any chars, ? - single char, # - single digit)
Re: Check if date [today,now] in range of startdate and endd
Of course it is possible.
It only depends on someone who is writing the code
But...
How do you want to decide if
StartDate: [20*]
EndDate: [30*]
means the day of the month or the minute of the hour?
Which means the implementation of the wildcards is very very tricky if not unpossible.
Better would be always to use a full format with wildcards like:
????.20.?? ??:??:?? or ????.??.?? ??:20:??
Bernd
It only depends on someone who is writing the code
But...
How do you want to decide if
StartDate: [20*]
EndDate: [30*]
means the day of the month or the minute of the hour?
Which means the implementation of the wildcards is very very tricky if not unpossible.
Better would be always to use a full format with wildcards like:
????.20.?? ??:??:?? or ????.??.?? ??:20:??
Bernd
Re: Check if date [today,now] in range of startdate and endd
RSBasic is right.
The StartTime and EndTime depends on your work to get the right values out of your wildcards...
The StartTime and EndTime depends on your work to get the right values out of your wildcards...
Re: Check if date [today,now] in range of startdate and endd
I'm sorry for not giving the brief details.
1. Input date are extracted to FullDate: %dd.%mm.%yyyy %hh:%ii (no %ss and '.' and ':' as devisors)
According to presence of ':' and '.' correct DateFormat should be formed.
20* (no devisor) understood as 20.##.#### ##:##
1* -> 1#.##.#### ##:##
13:* -> ##.##.#### 13:##
08.03* -> 08.03.#### ##.##
31.12.* 23:59 -> 31.12.#### 23:59 etc
StartDate and EndDate should be converted to ##.##.#### ##:## (I think it is very difficult)
2. The most difficult part.
check today if between StartDate and EndDate
Assume
StartDate is converted to ##.##.#### 19:00
EndDate is ##.##.#### 09:00
now is 28.10.2015 21:05 which is valid
now is 28.10.2015 18:55 which is invalid
StartDate is converted to 27.##.#### 19:00
EndDate is 31.##.#### 09:00
now is 28.10.2015 21:05 which is valid
now is 28.10.2015 18:55 which is invalid
again, extracting date range between StartDate and EndDate even this year or this month is very uncomfortable.
may be there is a way to do it with date functions or sql commands.
I am not familiar with SQL
1. Input date are extracted to FullDate: %dd.%mm.%yyyy %hh:%ii (no %ss and '.' and ':' as devisors)
According to presence of ':' and '.' correct DateFormat should be formed.
20* (no devisor) understood as 20.##.#### ##:##
1* -> 1#.##.#### ##:##
13:* -> ##.##.#### 13:##
08.03* -> 08.03.#### ##.##
31.12.* 23:59 -> 31.12.#### 23:59 etc
StartDate and EndDate should be converted to ##.##.#### ##:## (I think it is very difficult)
2. The most difficult part.
check today if between StartDate and EndDate
Assume
StartDate is converted to ##.##.#### 19:00
EndDate is ##.##.#### 09:00
now is 28.10.2015 21:05 which is valid
now is 28.10.2015 18:55 which is invalid
StartDate is converted to 27.##.#### 19:00
EndDate is 31.##.#### 09:00
now is 28.10.2015 21:05 which is valid
now is 28.10.2015 18:55 which is invalid
again, extracting date range between StartDate and EndDate even this year or this month is very uncomfortable.
may be there is a way to do it with date functions or sql commands.
I am not familiar with SQL
Re: Check if date [today,now] in range of startdate and endd
Check out the manual....
All you need is in the date library !
To convert your input into dates, use the string library.
There is no need of using the database functions....
Nobody, except yourself, will write your code
All you need is in the date library !
To convert your input into dates, use the string library.
There is no need of using the database functions....
Nobody, except yourself, will write your code
Re: Check if date [today,now] in range of startdate and endd
Thanx much.
I agree,
I start to write and lets C what it looks like
I agree,
I start to write and lets C what it looks like
Re: Check if date [today,now] in range of startdate and endd
I have solved in this way (@ least its OK for Me)
Code: Select all
ToDay$ = FormatDate("%dd.%mm.%yyyy %hh:%ii", Date())
ToDayDD$ = Mid(ToDay$,1,2)
ToDayMM$ = Mid(ToDay$,4,2)
ToDayYYYY$= Mid(ToDay$,7,4)
ToDayHH$ = Mid(ToDay$,12,2)
ToDayII$ = Mid(ToDay$,15,2)
;{ StarDate
StarDate$ = InputRequester("StarDate","Please input *StarDate*",FormatDate("%dd.%mm.%yyyy %hh:%ii", Date()));*1**3***:****0*****0******
If Len(StarDate$)>=2
StarDateDD$=Left(StarDate$,2)
If Left(StarDateDD$,1)="0" Or (Val(Left(StarDateDD$,1))>0 And Val(Left(StarDateDD$,1))<4)
StarDateDD$=StarDateDD$
Else
StarDateDD$=Left(ToDayDD$,1)+Right(StarDateDD$,1)
EndIf
If Right(StarDateDD$,1)="0" Or (Val(Right(StarDateDD$,1))>0 And Val(Right(StarDateDD$,1))<=9)
StarDateDD$=StarDateDD$
Else
StarDateDD$=Left(StarDateDD$,1)+Right(ToDayDD$,1)
EndIf
If Val(StarDateDD$)>0 And Val(StarDateDD$)<=31
StarDateDD$=StarDateDD$
Else
StarDateDD$=ToDayDD$
EndIf
Else
StarDateDD$=ToDayDD$
EndIf
If (Mid(StarDate$,3,1)="#" Or Mid(StarDate$,3,1)="0" Or Val(Mid(StarDate$,3,1))>0) And (Mid(StarDate$,4,1)="#" Or Mid(StarDate$,4,1)="0" Or Val(Mid(StarDate$,4,1))>0)
StarDateMM$=Mid(StarDate$,3,2)
If Left(StarDateMM$,1)="#" Or Val(Left(StarDateMM$,1))>1
StarDateMM$=Left(ToDayMM$,1)+Right(StarDateMM$,1)
EndIf
If Right(StarDateMM$,1)="#"
StarDateMM$=Left(StarDateMM$,1)+Right(ToDayMM$,1)
EndIf
If Val(StarDateMM$)>0 And Val(StarDateMM$)<=12
StarDateMM$=StarDateMM$
Else
StarDateMM$=ToDayMM$
EndIf
ElseIf (Mid(StarDate$,4,1)="#" Or Mid(StarDate$,4,1)="0" Or Val(Mid(StarDate$,4,1))>0) And (Mid(StarDate$,5,1)="#" Or Mid(StarDate$,5,1)="0" Or Val(Mid(StarDate$,5,1))>0)
StarDateMM$=Mid(StarDate$,4,2)
If Left(StarDateMM$,1)="#" Or Val(Left(StarDateMM$,1))>1
StarDateMM$=Left(ToDayMM$,1)+Right(StarDateMM$,1)
EndIf
If Right(StarDateMM$,1)="#"
StarDateMM$=Left(StarDateMM$,1)+Right(ToDayMM$,1)
EndIf
If Val(StarDateMM$)>0 And Val(StarDateMM$)<=12
StarDateMM$=StarDateMM$
Else
StarDateMM$=ToDayMM$
EndIf
Else
StarDateMM$=ToDayMM$
EndIf
If (Mid(StarDate$,5,1)="#" Or Mid(StarDate$,5,1)="0" Or Val(Mid(StarDate$,5,1))>0) And (Mid(StarDate$,6,1)="#" Or Mid(StarDate$,6,1)="0" Or Val(Mid(StarDate$,6,1))>0) And (Mid(StarDate$,7,1)="#" Or Mid(StarDate$,7,1)="0" Or Val(Mid(StarDate$,7,1))>0) And (Mid(StarDate$,8,1)="#" Or Mid(StarDate$,8,1)="0" Or Val(Mid(StarDate$,8,1))>0)
StarDateYYYY$=Mid(StarDate$,5,4)
If Mid(StarDateYYYY$,1,1)="#"
StarDateYYYY$=Mid(ToDayYYYY$,1,1)+Mid(StarDateYYYY$,2,3)
EndIf
If Mid(StarDateYYYY$,2,1)="#"
StarDateYYYY$=Mid(StarDateYYYY$,1,1)+Mid(ToDayYYYY$,2,1)+Mid(StarDateYYYY$,3,2)
EndIf
If Mid(StarDateYYYY$,3,1)="#"
StarDateYYYY$=Mid(StarDateYYYY$,1,2)+Mid(ToDayYYYY$,3,1)+Mid(StarDateYYYY$,4,1)
EndIf
If Mid(StarDateYYYY$,4,1)="#"
StarDateYYYY$=Mid(StarDateYYYY$,1,3)+Mid(ToDayYYYY$,4,1)
EndIf
If Val(StarDateYYYY$)>=Val(ToDayYYYY$)+5 Or Val(StarDateYYYY$)<=0
StarDateYYYY$=ToDayYYYY$
Else
StarDateYYYY$=StarDateYYYY$
EndIf
ElseIf (Mid(StarDate$,7,1)="#" Or Mid(StarDate$,7,1)="0" Or Val(Mid(StarDate$,7,1))>0) And (Mid(StarDate$,8,1)="#" Or Mid(StarDate$,8,1)="0" Or Val(Mid(StarDate$,8,1))>0) And (Mid(StarDate$,9,1)="#" Or Mid(StarDate$,9,1)="0" Or Val(Mid(StarDate$,9,1))>0) And (Mid(StarDate$,10,1)="#" Or Mid(StarDate$,10,1)="0" Or Val(Mid(StarDate$,10,1))>0)
StarDateYYYY$=Mid(StarDate$,7,4)
If Mid(StarDateYYYY$,1,1)="#"
StarDateYYYY$=Mid(ToDayYYYY$,1,1)+Mid(StarDateYYYY$,2,3)
EndIf
If Mid(StarDateYYYY$,2,1)="#"
StarDateYYYY$=Mid(StarDateYYYY$,1,1)+Mid(ToDayYYYY$,2,1)+Mid(StarDateYYYY$,3,2)
EndIf
If Mid(StarDateYYYY$,3,1)="#"
StarDateYYYY$=Mid(StarDateYYYY$,1,2)+Mid(ToDayYYYY$,3,1)+Mid(StarDateYYYY$,4,1)
EndIf
If Mid(StarDateYYYY$,4,1)="#"
StarDateYYYY$=Mid(StarDateYYYY$,1,3)+Mid(ToDayYYYY$,4,1)
EndIf
If Val(StarDateYYYY$)>=Val(ToDayYYYY$)+5 Or Val(StarDateYYYY$)<=0
StarDateYYYY$=ToDayYYYY$
Else
StarDateYYYY$=StarDateYYYY$
EndIf
Else
StarDateYYYY$=ToDayYYYY$
EndIf
If Mid(StarDate$,Len(StarDate$)-2,1)=":"
StarDateHH$=Mid(StarDate$,Len(StarDate$)-4,2)
If Left(StarDateHH$,1)="#"
StarDateHH$=Left(ToDayHH$,1)+Right(StarDateHH$,1)
ElseIf Left(StarDateHH$,1)="0" Or Left(StarDateHH$,1)="1" Or Left(StarDateHH$,1)="2"
StarDateHH$=StarDateHH$
Else
StarDateHH$=Left(ToDayHH$,1)+Right(StarDateHH$,1)
EndIf
If Right(StarDateHH$,1)="#"
StarDateHH$=Left(StarDateHH$,1)+Right(ToDayHH$,1)
ElseIf Right(StarDateHH$,1)="0" Or (Val(Right(StarDateHH$,1))>0 And Val(Right(StarDateHH$,1))<=9)
StarDateHH$=StarDateHH$
Else
StarDateHH$=Left(StarDateHH$,1)+Right(ToDayHH$,1)
EndIf
If Val(StarDateHH$)>=0 And Val(StarDateHH$)<=23
StarDateHH$=StarDateHH$
Else
StarDateHH$=ToDayHH$
EndIf
Else
StarDateHH$=ToDayHH$
EndIf
If Mid(StarDate$,Len(StarDate$)-2,1)=":"
StarDateII$=Mid(StarDate$,Len(StarDate$)-1,2)
If Left(StarDateII$,1)="#"
StarDateII$=Left(ToDayII$,1)+Right(StarDateII$,1)
ElseIf Left(StarDateII$,1)="0" Or Val(Left(StarDateII$,1))>0 Or Val(Left(StarDateII$,1))<6
StarDateII$=StarDateII$
Else
StarDateII$=Left(ToDayII$,1)+Right(StarDateII$,1)
EndIf
If Right(StarDateII$,1)="#"
StarDateII$=Left(StarDateII$,1)+Right(ToDayII$,1)
ElseIf Right(StarDateII$,1)="0" Or (Val(Right(StarDateII$,1))>0 And Val(Right(StarDateII$,1))<=9)
StarDateII$=StarDateII$
Else
StarDateII$=Left(StarDateII$,1)+Right(ToDayII$,1)
EndIf
If Val(StarDateII$)>=0 And Val(StarDateII$)<=59
StarDateII$=StarDateII$
Else
StarDateII$=ToDayII$
EndIf
Else
StarDateII$=ToDayII$
EndIf
;}
;{ EnDate
EnDate$ = InputRequester("EnDate","Please input *EnDate*",FormatDate("%dd.%mm.%yyyy %hh:%ii", Date()));*1**3***:****0*****0******
If Len(EnDate$)>=2
EnDateDD$=Left(EnDate$,2)
If Left(EnDateDD$,1)="0" Or (Val(Left(EnDateDD$,1))>0 And Val(Left(EnDateDD$,1))<4)
EnDateDD$=EnDateDD$
Else
EnDateDD$=Left(ToDayDD$,1)+Right(EnDateDD$,1)
EndIf
If Right(EnDateDD$,1)="0" Or (Val(Right(EnDateDD$,1))>0 And Val(Right(EnDateDD$,1))<=9)
EnDateDD$=EnDateDD$
Else
EnDateDD$=Left(EnDateDD$,1)+Right(ToDayDD$,1)
EndIf
If Val(EnDateDD$)>0 And Val(EnDateDD$)<=31
EnDateDD$=EnDateDD$
Else
EnDateDD$=ToDayDD$
EndIf
Else
EnDateDD$=ToDayDD$
EndIf
If (Mid(EnDate$,3,1)="#" Or Mid(EnDate$,3,1)="0" Or Val(Mid(EnDate$,3,1))>0) And (Mid(EnDate$,4,1)="#" Or Mid(EnDate$,4,1)="0" Or Val(Mid(EnDate$,4,1))>0)
EnDateMM$=Mid(EnDate$,3,2)
If Left(EnDateMM$,1)="#" Or Val(Left(EnDateMM$,1))>1
EnDateMM$=Left(ToDayMM$,1)+Right(EnDateMM$,1)
EndIf
If Right(EnDateMM$,1)="#"
EnDateMM$=Left(EnDateMM$,1)+Right(ToDayMM$,1)
EndIf
If Val(EnDateMM$)>0 And Val(EnDateMM$)<=12
EnDateMM$=EnDateMM$
Else
EnDateMM$=ToDayMM$
EndIf
ElseIf (Mid(EnDate$,4,1)="#" Or Mid(EnDate$,4,1)="0" Or Val(Mid(EnDate$,4,1))>0) And (Mid(EnDate$,5,1)="#" Or Mid(EnDate$,5,1)="0" Or Val(Mid(EnDate$,5,1))>0)
EnDateMM$=Mid(EnDate$,4,2)
If Left(EnDateMM$,1)="#" Or Val(Left(EnDateMM$,1))>1
EnDateMM$=Left(ToDayMM$,1)+Right(EnDateMM$,1)
EndIf
If Right(EnDateMM$,1)="#"
EnDateMM$=Left(EnDateMM$,1)+Right(ToDayMM$,1)
EndIf
If Val(EnDateMM$)>0 And Val(EnDateMM$)<=12
EnDateMM$=EnDateMM$
Else
EnDateMM$=ToDayMM$
EndIf
Else
EnDateMM$=ToDayMM$
EndIf
If (Mid(EnDate$,5,1)="#" Or Mid(EnDate$,5,1)="0" Or Val(Mid(EnDate$,5,1))>0) And (Mid(EnDate$,6,1)="#" Or Mid(EnDate$,6,1)="0" Or Val(Mid(EnDate$,6,1))>0) And (Mid(EnDate$,7,1)="#" Or Mid(EnDate$,7,1)="0" Or Val(Mid(EnDate$,7,1))>0) And (Mid(EnDate$,8,1)="#" Or Mid(EnDate$,8,1)="0" Or Val(Mid(EnDate$,8,1))>0)
EnDateYYYY$=Mid(EnDate$,5,4)
If Mid(EnDateYYYY$,1,1)="#"
EnDateYYYY$=Mid(ToDayYYYY$,1,1)+Mid(EnDateYYYY$,2,3)
EndIf
If Mid(EnDateYYYY$,2,1)="#"
EnDateYYYY$=Mid(EnDateYYYY$,1,1)+Mid(ToDayYYYY$,2,1)+Mid(EnDateYYYY$,3,2)
EndIf
If Mid(EnDateYYYY$,3,1)="#"
EnDateYYYY$=Mid(EnDateYYYY$,1,2)+Mid(ToDayYYYY$,3,1)+Mid(EnDateYYYY$,4,1)
EndIf
If Mid(EnDateYYYY$,4,1)="#"
EnDateYYYY$=Mid(EnDateYYYY$,1,3)+Mid(ToDayYYYY$,4,1)
EndIf
If Val(EnDateYYYY$)>=Val(ToDayYYYY$)+5 Or Val(EnDateYYYY$)<=0
EnDateYYYY$=ToDayYYYY$
Else
EnDateYYYY$=EnDateYYYY$
EndIf
ElseIf (Mid(EnDate$,7,1)="#" Or Mid(EnDate$,7,1)="0" Or Val(Mid(EnDate$,7,1))>0) And (Mid(EnDate$,8,1)="#" Or Mid(EnDate$,8,1)="0" Or Val(Mid(EnDate$,8,1))>0) And (Mid(EnDate$,9,1)="#" Or Mid(EnDate$,9,1)="0" Or Val(Mid(EnDate$,9,1))>0) And (Mid(EnDate$,10,1)="#" Or Mid(EnDate$,10,1)="0" Or Val(Mid(EnDate$,10,1))>0)
EnDateYYYY$=Mid(EnDate$,7,4)
If Mid(EnDateYYYY$,1,1)="#"
EnDateYYYY$=Mid(ToDayYYYY$,1,1)+Mid(EnDateYYYY$,2,3)
EndIf
If Mid(EnDateYYYY$,2,1)="#"
EnDateYYYY$=Mid(EnDateYYYY$,1,1)+Mid(ToDayYYYY$,2,1)+Mid(EnDateYYYY$,3,2)
EndIf
If Mid(EnDateYYYY$,3,1)="#"
EnDateYYYY$=Mid(EnDateYYYY$,1,2)+Mid(ToDayYYYY$,3,1)+Mid(EnDateYYYY$,4,1)
EndIf
If Mid(EnDateYYYY$,4,1)="#"
EnDateYYYY$=Mid(EnDateYYYY$,1,3)+Mid(ToDayYYYY$,4,1)
EndIf
If Val(EnDateYYYY$)>=Val(ToDayYYYY$)+5 Or Val(EnDateYYYY$)<=0
EnDateYYYY$=ToDayYYYY$
Else
EnDateYYYY$=EnDateYYYY$
EndIf
Else
EnDateYYYY$=ToDayYYYY$
EndIf
If Mid(EnDate$,Len(EnDate$)-2,1)=":"
EnDateHH$=Mid(EnDate$,Len(EnDate$)-4,2)
If Left(EnDateHH$,1)="#"
EnDateHH$=Left(ToDayHH$,1)+Right(EnDateHH$,1)
ElseIf Left(EnDateHH$,1)="0" Or Left(EnDateHH$,1)="1" Or Left(EnDateHH$,1)="2"
EnDateHH$=EnDateHH$
Else
EnDateHH$=Left(ToDayHH$,1)+Right(EnDateHH$,1)
EndIf
If Right(EnDateHH$,1)="#"
EnDateHH$=Left(EnDateHH$,1)+Right(ToDayHH$,1)
ElseIf Right(EnDateHH$,1)="0" Or (Val(Right(EnDateHH$,1))>0 And Val(Right(EnDateHH$,1))<=9)
EnDateHH$=EnDateHH$
Else
EnDateHH$=Left(EnDateHH$,1)+Right(ToDayHH$,1)
EndIf
If Val(EnDateHH$)>=0 And Val(EnDateHH$)<=23
EnDateHH$=EnDateHH$
Else
EnDateHH$=ToDayHH$
EndIf
Else
EnDateHH$=ToDayHH$
EndIf
If Mid(EnDate$,Len(EnDate$)-2,1)=":"
EnDateII$=Mid(EnDate$,Len(EnDate$)-1,2)
If Left(EnDateII$,1)="#"
EnDateII$=Left(ToDayII$,1)+Right(EnDateII$,1)
ElseIf Left(EnDateII$,1)="0" Or Val(Left(EnDateII$,1))>0 Or Val(Left(EnDateII$,1))<6
EnDateII$=EnDateII$
Else
EnDateII$=Left(ToDayII$,1)+Right(EnDateII$,1)
EndIf
If Right(EnDateII$,1)="#"
EnDateII$=Left(EnDateII$,1)+Right(ToDayII$,1)
ElseIf Right(EnDateII$,1)="0" Or (Val(Right(EnDateII$,1))>0 And Val(Right(EnDateII$,1))<=9)
EnDateII$=EnDateII$
Else
EnDateII$=Left(EnDateII$,1)+Right(ToDayII$,1)
EndIf
If Val(EnDateII$)>=0 And Val(EnDateII$)<=59
EnDateII$=EnDateII$
Else
EnDateII$=ToDayII$
EndIf
Else
EnDateII$=ToDayII$
EndIf
;}
StarDate=Date(Val(StarDateYYYY$), Val(StarDateMM$), Val(StarDateDD$), Val(StarDateHH$), Val(StarDateII$), 00);Val(FormatDate("%ss", Date())))
EnDate =Date(Val(EnDateYYYY$), Val(EnDateMM$), Val(EnDateDD$), Val(EnDateHH$), Val(EnDateII$), 00)
ToDay =Date(Val(ToDayYYYY$), Val(ToDayMM$), Val(ToDayDD$), Val(ToDayHH$), Val(ToDayII$), 00)
; Debug "StarDate: "+StarDateDD$+"."+StarDateMM$+"."+StarDateYYYY$+" "+StarDateHH$+":"+StarDateII$+"="+Str(StarDate)
; Debug "EnDate: "+EnDateDD$+"."+EnDateMM$+"."+EnDateYYYY$+" "+EnDateHH$+":"+EnDateII$+"="+Str(EnDate)
; Debug "ToDay: "+ToDayDD$+"."+ToDayMM$+"."+ToDayYYYY$+" "+ToDayHH$+":"+ToDayII$+"="+Str(ToDay)
; Debug FormatDate("%dd.%mm.%yyyy %hh:%ii", Date())
; Debug Date(Val(FormatDate("%yyyy", Date())), Val(FormatDate("%mm", Date())), Val(FormatDate("%dd", Date())), Val(FormatDate("%hh", Date())), Val(FormatDate("%ii", Date())), Val(FormatDate("%ss", Date())))
; Debug FormatDate("%dd-%mm-%yyyy", Date(Val(FormatDate("%yyyy", Date())), Val(FormatDate("%mm", Date())), Val(FormatDate("%dd", Date())), Val(FormatDate("%hh", Date())), Val(FormatDate("%ii", Date())), Val(FormatDate("%ss", Date()))))
; Debug FormatDate("%dd-%mm-%yyyy %hh:%ii:%ss", 1445985072)
If ToDay>=StarDate And ToDay<=EnDate
Debug "Itz Time"
ElseIf ToDay<StarDate
sex = StarDate-ToDay
If sex <= 60
veyt$=Str(sex)+" seconds"
ElseIf sex < 3600 And sex > 60
veyt$=Str(sex/60)+" minutes"
ElseIf sex < 86400 And sex > 3600
veyt$=Str(sex/3600)+" hours"
ElseIf sex < 31536000 And sex > 86400
veyt$=Str(sex/(86400))+" days"
ElseIf sex > 31536000
veyt$=Str(sex/(31536000))+" years"
EndIf
Debug "You Have To Wait For "+veyt$
ElseIf ToDay>EnDate
sex = ToDay-EnDate
If sex <= 60
exp$=Str(sex)+" seconds"
ElseIf sex < 3600 And sex > 60
exp$=Str(sex/60)+" minutes"
ElseIf sex < 86400 And sex > 3600
exp$=Str(sex/3600)+" hours"
ElseIf sex < 31536000 And sex > 86400
exp$=Str(sex/(86400))+" days"
ElseIf sex > 31536000
exp$=Str(sex/(31536000))+" years"
EndIf
Debug "Task Expired For "+exp$
EndIf




