 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Adam
Joined: 21 Dec 2002 Posts: 4
|
|
Date Time Functions |
|
DayName, IsWeekend, IsWeekday. None of them work. I used day name and fed it both the raw date, and the system returned date in a variable. Today is 12/21/2002. DayName returns Monday, and IsWeekend returns FALSE, IsWeekday returns TRUE. Is this a bug with a fix available. I'd really like to suspend certain jobs on the weekends, but this problem makes it impossible. Thank you, Adam
|
|
Sat Dec 21, 2002 1:59 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7966
|
|
Re: Date Time Functions |
|
I agree with you today is 12/21/2002, but in your script... Can you post your script so I can tell you why it returns values for 12/22/2002? : DayName, IsWeekend, IsWeekday. None of them work. I used day name and fed : it both the raw date, and the system returned date in a variable. Today is : 12/21/2002. : DayName returns Monday, and IsWeekend returns FALSE, IsWeekday returns TRUE. : Is this a bug with a fix available. I'd really like to suspend : certain jobs on the weekends, but this problem makes it impossible. : Thank you, : Adam
|
|
Sat Dec 21, 2002 2:32 pm |
|
 |
Adam
Joined: 21 Dec 2002 Posts: 4
|
|
Re: Date Time Functions |
|
: I agree with you today is 12/21/2002, but in your script... : Can you post your script so I can tell you why it returns values for : 12/22/2002? I broke it down to just three lines and get the same result. Here they are: Dim(TodaysDay, String) DayName( "12/21/2002", TodaysDay ) MessageBox( TodaysDay ) It returns "Monday"
|
|
Sat Dec 21, 2002 2:41 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7966
|
|
Re: Date Time Functions |
|
Interesting... something with the string to date conversion in DayName call. If you turn on the tracing you will see that the second line in your script is not executed as you expect it. Here is a copy & paste from the 24x7 trace window JAL 1: DIM JAL 1: Executing DIM("TODAYSDAY", "STRING") JAL 2: DAYNAME JAL 2: Executing DAYNAME("1/1/1900", "") JAL Return "Monday" JAL 3: MESSAGEBOX Anyway, try the following: Dim(TodaysDay, String) Dim(TodaysDate, Date) Set(TodaysDate, "12/21/2002") DayName( TodaysDate, TodaysDay ) MessageBox( TodaysDay ) : I broke it down to just three lines and get the same result. Here they are: : Dim(TodaysDay, String) : DayName( "12/21/2002", TodaysDay ) : MessageBox( TodaysDay ) : It returns "Monday"
|
|
Sat Dec 21, 2002 3:03 pm |
|
 |
Adam
Joined: 21 Dec 2002 Posts: 4
|
|
Re: Date Time Functions |
|
I will try that. Originally I had set a variable to TODAY, and it still worked the same. I did not use the SET command though. I will give that a try. Thanks. : Interesting... something with the string to date conversion in DayName call. : If you turn on the tracing you will see that the second line in your : script is not executed as you expect it. Here is a copy & paste from : the 24x7 trace window : JAL 1: DIM : JAL 1: Executing DIM("TODAYSDAY", "STRING") : JAL 2: DAYNAME : JAL 2: Executing DAYNAME("1/1/1900", "") : JAL Return "Monday" : JAL 3: MESSAGEBOX : Anyway, try the following: Dim(TodaysDay, String) : Dim(TodaysDate, Date) : Set(TodaysDate, "12/21/2002") : DayName( TodaysDate, TodaysDay ) : MessageBox( TodaysDay )
|
|
Mon Dec 23, 2002 10:28 am |
|
 |
Adam
Joined: 21 Dec 2002 Posts: 4
|
|
Re: Date Time Functions |
|
The following 3 lines of code worked perfectly. Today( TodaysDateI ) Set( TodaysDateII, TodaysDateI ) DayName( TodaysDateII, TodaysDay ) : I will try that. Originally I had set a variable to TODAY, and : it still worked the same. I did not use the SET command though. I will : give that a try. : Thanks.
|
|
Tue Dec 24, 2002 4:19 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|