SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Date Time Functions

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Date Time Functions
Author Message
Adam



Joined: 21 Dec 2002
Posts: 4

Post Date Time Functions Reply with quote

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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7966

Post Re: Date Time Functions Reply with quote

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 View user's profile Send private message
Adam



Joined: 21 Dec 2002
Posts: 4

Post Re: Date Time Functions Reply with quote

: 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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7966

Post Re: Date Time Functions Reply with quote

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 View user's profile Send private message
Adam



Joined: 21 Dec 2002
Posts: 4

Post Re: Date Time Functions Reply with quote

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 View user's profile Send private message
Adam



Joined: 21 Dec 2002
Posts: 4

Post Re: Date Time Functions Reply with quote

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 View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.