Day of week from Pocket Watch B
Hi All,
I have a BS2, Pocket watch B and Parallax's voice module hooked up as a
talking clock. In addition to the time and date, I would like to say the name
of the day. Is there anyway to calculate the day of the week from the date
with just the BS2?
Jerry
[noparse][[/noparse]Non-text portions of this message have been removed]
I have a BS2, Pocket watch B and Parallax's voice module hooked up as a
talking clock. In addition to the time and date, I would like to say the name
of the day. Is there anyway to calculate the day of the week from the date
with just the BS2?
Jerry
[noparse][[/noparse]Non-text portions of this message have been removed]
Comments
>I have a BS2, Pocket watch B and Parallax's voice module hooked up as a
>talking clock. In addition to the time and date, I would like to say the name
>of the day. Is there anyway to calculate the day of the week from the date
>with just the BS2?
>
>Jerry
Given YY from 1 to 99 (for 2001 to 2099), MM as month from 1 to 12,
and DD from 0 to 31 (day of current month), the following formula
calculates the day of the week. Oh, YY, MM and DD have to be binary,
not BCD numbers.
dayofweek: 'Sunday=0,Monday=1, Tuesday=2,..,Saturday=6
DOW=MM-1*30+(MM/9+MM/2)-(MM max 3/3*(YY//4 max 1 +1))+
DD+(YY-1//100*365)+(YY//100/4)//7
See <http://www.emesystems.com/BS2math4.htm#JulianDate> for
explanation. The formula computes the ordinal number of days
starting with Jan 1 2001 as number 1, which was a Monday. Then it
divides modulo 7 to get the day of the week for any day in the
century.
Hmmm. I thought the pocket watch B had a day-of-week output, no?
-- regards,
Tracy Allen
electronically monitored ecosystems
mailto:tracy@e...
http://www.emesystems.com
that should be DD from 1 to 31 ...
>
Thanks guys.
All the links appear valid and I got some good info...and I copied Tracy's
formula into the code and it worked just fine...that little parallax speech
module is just talking his head off..including the day of the week now..
I didn't find anything in the pwb's docs that it returned the day of the
week....
Jerry
[noparse][[/noparse]Non-text portions of this message have been removed]
Take a look at
http://www.terra.es/personal2/grimmer/calendar.htm
This may provide what you seek.
Regards peter
Oorspronkelijk bericht
Van: CGIJERRY@A... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=ylX-mh-ZHawuCo_6WWSwP3rJ8IIsqDWEfe3uTKtU_ru3FUWA82tMIxm-S6PFdMjTYwM9JZeBQYg]CGIJERRY@A...[/url
Verzonden: zaterdag 5 januari 2002 4:37
Aan: basicstamps@yahoogroups.com
Onderwerp: [noparse][[/noparse]basicstamps] Day of week from Pocket Watch B
Hi All,
I have a BS2, Pocket watch B and Parallax's voice module hooked up as a
talking clock. In addition to the time and date, I would like to say the
name
of the day. Is there anyway to calculate the day of the week from the date
with just the BS2?
Jerry
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
First click introduction, otherwise not all links seem to work.
From there use the previous/next arrows at bottom of pages.
Regards peter
Oorspronkelijk bericht
Van: CGIJERRY@A... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=-qtj0BQ_v0SwXdeEDYJ_akuH3lsXmMUBBDfWfpQWgSqEVajsM26xUYTC75J8SGhJLFXq05_kEAW1CLo]CGIJERRY@A...[/url
Verzonden: zaterdag 5 januari 2002 4:37
Aan: basicstamps@yahoogroups.com
Onderwerp: [noparse][[/noparse]basicstamps] Day of week from Pocket Watch B
Hi All,
I have a BS2, Pocket watch B and Parallax's voice module hooked up as a
talking clock. In addition to the time and date, I would like to say the
name
of the day. Is there anyway to calculate the day of the week from the date
with just the BS2?
Jerry
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/