Is there a way to get a day number instead of a formatted date - without calculating it out from the m/d/y ? Maybe in vbscript?
I need to generate text in a different color on alternate days, maybe someone has a better idea how to do that without looking for odd/even day numbers?
Day number instead of formatted date?
Moderators: Dorian (MJT support), JRL
Yes, just use the Day function:
Day>result
Returns the current day number of the month in the specified variable.
Day>result
Returns the current day number of the month in the specified variable.
MJT Net Support
[email protected]
[email protected]
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Day>variable to get day number
===========================
Using Odd/Even will not work because of months with odd numbered days.
Using +1 and -1 works in many cases for toggling just by multiplying current value * -1. So -1 becomes +1 and +1 becomes -1, etc.
===========================
Using Odd/Even will not work because of months with odd numbered days.
Using +1 and -1 works in many cases for toggling just by multiplying current value * -1. So -1 becomes +1 and +1 becomes -1, etc.
Code: Select all
Let>Status=1
Label>Toggle
IF>%Status%=1,Color1,Color2
Label>Color1
Do stuff for color1
Goto>More
Label>Color2
Do stuff for color2
Goto>More
Label>More
IF>Conditions for Done,StopToggle
Let>Status=%Status%*-1
Goto>Toggle
LAbel>StopToggle
Do stuff.....
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
I was thinking of a day serial number since some long ago day, like the date in excel.
Toggling's a good idea but it really is date/day dependent. This thing runs each hour and populates a table with fixed locations for the time. For example today's 9:00 AM value overwrites yesterday's 9:00 AM value, but until 10:00 AM the next entry in the table is from yesterday (don't shoot me I didn't invent the format) and it needs a way to highlight that it's not today's data for folks who just scan the table and have a poor sense of time.
Toggling's a good idea but it really is date/day dependent. This thing runs each hour and populates a table with fixed locations for the time. For example today's 9:00 AM value overwrites yesterday's 9:00 AM value, but until 10:00 AM the next entry in the table is from yesterday (don't shoot me I didn't invent the format) and it needs a way to highlight that it's not today's data for folks who just scan the table and have a poor sense of time.
How about the date in Julian form:
http://www.mjtnet.com/forum/viewtopic.php?t=1463
Does that help?
Or to get a unique number based on the time/date just do:
Year>yy
Month>mm
Day>dd
Hour>hh
Min>m
Sec>s
Let>tval=%yy%%mm%%dd%%hh%%m%%s%
http://www.mjtnet.com/forum/viewtopic.php?t=1463
Does that help?
Or to get a unique number based on the time/date just do:
Year>yy
Month>mm
Day>dd
Hour>hh
Min>m
Sec>s
Let>tval=%yy%%mm%%dd%%hh%%m%%s%
MJT Net Support
[email protected]
[email protected]
Hmm, I think that must be a different Julian date. This one makes more sense:
VBSTART
Function MyJulian
y=Year(Now)
m=Month(Now)
d=Day(Now)
MyJulian = ( 1461 * ( y + 4800 + ( m - 14 ) / 12 ) ) / 4 + _
( 367 * ( m - 2 - 12 * ( ( m - 14 ) / 12 ) ) ) / 12 - _
( 3 * ( ( y + 4900 + ( m - 14 ) / 12 ) / 100 ) ) / 4 + d - 32075
End Function
VBEND
VBEval>MyJulian,jDate
VBSTART
Function MyJulian
y=Year(Now)
m=Month(Now)
d=Day(Now)
MyJulian = ( 1461 * ( y + 4800 + ( m - 14 ) / 12 ) ) / 4 + _
( 367 * ( m - 2 - 12 * ( ( m - 14 ) / 12 ) ) ) / 12 - _
( 3 * ( ( y + 4900 + ( m - 14 ) / 12 ) / 100 ) ) / 4 + d - 32075
End Function
VBEND
VBEval>MyJulian,jDate
MJT Net Support
[email protected]
[email protected]