1. Calendar ?

Given a date:, ie:
July 29, 2003...
is there a simple way to calculate the day of the week: ie:
  ...it's Tuesday !

( @#$% stupid MC146818 )
Wolf

new topic     » topic index » view message » categorize

2. Re: Calendar ?

Wolf wrote:
> Given a date:, ie:
> July 29, 2003...
> is there a simple way to calculate the day of the week: ie:
>   ...it's Tuesday !

Junko wrote a program for this a long time ago.
It's in the Archive:

     http://www.rapideuphoria.com/daybdate.zip

Regards,
    Rob Craig
    Rapid Deployment Software
    http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: Calendar ?

This has definately been done.  Someone should give you the solution soon.
I don't have it at hand right now though.  Elliott, Robsz, Bensler, jbrown,
one of you care to steal it form a copy of my irc2html.exe

Remember it creates that index.html page. In doing so it computes the day
of the week based on the date.

        Lucius L. Hilley III

----- Original Message ----- 
From: "Wolf" <wolfritz at KING.IGS.NET>
To: "EUforum" <EUforum at topica.com>
Sent: Tuesday, July 29, 2003 01:16 PM
Subject: Calendar ?


> 
> 
> Given a date:, ie:
> July 29, 2003...
> is there a simple way to calculate the day of the week: ie:
>   ...it's Tuesday !
> 
> ( @#$% stupid MC146818 )
> Wolf
> 
> --^----------------------------------------------------------------
> This email was sent to: l3euphoria at bellsouth.net
> 
> 
> TOPICA - Start your own email discussion group. FREE!
> 
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: Calendar ?

> Given a date:, ie:
> July 29, 2003...
> is there a simple way to calculate the day of the week: ie:
>   ...it's Tuesday !
>
> ( @#$% stupid MC146818 )

Here's some interesting, fun, and useful links:

   http://www.terra.es/personal2/grimmer/

http://www.fos.su.se/physical/stefan/perl/scripts/date_and_time/zeller.date.
pl
   http://quasar.as.utexas.edu/BillInfo/doomsday.html
   http://www.cs.princeton.edu/~rpeterso/date_trick.html
   http://www.sislands.com/jscript/week3/dayofwk.htm
   http://rudy.ca/doomsday.html
   http://jonathan.rawle.org/hyperpedia/daycal.htm

Some of them duplicate the "Doomsday" calculation algorithm. Ah well!

Let me know which one of the above is best... :)

Thanks,
ck

new topic     » goto parent     » topic index » view message » categorize

5. Re: Calendar ?

This is a multi-part message in MIME format.
--------------59C3BA08093E8B419DE677BA

Wolf wrote:
> 
> Given a date:, ie:
> July 29, 2003...
> is there a simple way to calculate the day of the week: ie:
>   ...it's Tuesday !
> 
Hi Wolf,

I attached the file 'datetime.zip', it contains 'datetime.e' which has
several date conversion functions and also mum_of_weekday(). Look into
the test program 'datetime.ex'.

Have a nice day, Rolf
--------------59C3BA08093E8B419DE677BA
Content-Type: application/x-zip-compressed;
 name="DATETIME.zip"

new topic     » goto parent     » topic index » view message » categorize

6. Re: Calendar ?

> Wolf wrote:
> > Given a date:, ie:
> > July 29, 2003...
> > is there a simple way to calculate the day of the week: ie:
> >   ...it's Tuesday !
>
> Junko wrote a program for this a long time ago.
> It's in the Archive:
>
>      http://www.rapideuphoria.com/daybdate.zip

I suspected there was probably some code already written. Next time I'll
check the library first. ;)

new topic     » goto parent     » topic index » view message » categorize

7. Re: Calendar ?

OK, thanks to all!
Now just gotta convert one of these Doomsday/Gregorian algo's to 8 bit
6803/6502'ish code,
.. ignoring the  Y2K100  bug, of course  blink

Wolf

new topic     » goto parent     » topic index » view message » categorize

8. Re: Calendar ?

On Tue, 29 Jul 2003 13:16:47 -0400, Wolf <wolfritz at KING.IGS.NET>
wrote:

>Given a date:, ie:
>July 29, 2003...
>is there a simple way to calculate the day of the week: ie:
>  ...it's Tuesday !
>
Try this, though I have suspicions it won't work for 2000 and before:
---- Tomohiko Sakamoto=20
constant t=3D{ 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 }
function dow(integer d, integer m, integer y)
integer k
	y -=3D m < 3
	k=3Dfloor(y/100)
	return remainder(y+floor((y+k)/4)-k+t[m]+d,7)
end function

Pete

new topic     » goto parent     » topic index » view message » categorize

9. Re: Calendar ?

Wolf wrote:
> Given a date:, ie:
> July 29, 2003...
> is there a simple way to calculate the day of the week: ie:
>   ...it's Tuesday !

Junko wrote a program for this a long time ago.
It's in the Archive:

     http://www.rapideuphoria.com/daybdate.zip

I suspected there was probably some code already written. Next time I'll
check the library first. ;)








-- 
Regards,
    Rob Craig
    Rapid Deployment Software
    http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

10. Re: Calendar ?

On 29 Jul 2003, at 13:16, Wolf wrote:

> ( @#$% stupid MC146818 )

Try a DS12885 ?

Kat

new topic     » goto parent     » topic index » view message » categorize

11. Re: Calendar ?

On 29 Jul 2003, at 14:35, Wolf wrote:

> 
> 
> OK, thanks to all!
> Now just gotta convert one of these Doomsday/Gregorian algo's to 8 bit
> 6803/6502'ish code, .. ignoring the  Y2K100  bug, of course  blink

Since there are C64 programs that read and use msdos-formatted 
harddrives, i imagine they handle the dates that M$/dos/windoze stamped 
them with. Check them out. The C64 is 6510, 6502 core.

Kat

new topic     » goto parent     » topic index » view message » categorize

12. Re: Calendar ?

Wolf wrote:

> Given a date:, ie:
> July 29, 2003...
> is there a simple way to calculate the day of the week: ie:
>   ...it's Tuesday !

Junko Miura's day of week function is probably the way to go if all you 
want is that one function. (I searched on 'Junko week' in the archive 
and it came out top.)

For overkill, there's my library (Rolf Schroeder already posted his 
datetime.e, so perhaps me posting mine is redundant; But I can't resist 
a plug :) )  and docs at http://www.cyreksoft.yorks.com/euphoria/

For those griping about the fact a function returns a day of week for an 
invalid date (like Feb. 30th) there's a validDayOfWeek() function that 
returns -1 when the date is invalid.

Carl

-- 
[ Carl R White == aka () = The Domain of Cyrek = ]
[ Cyrek the Illogical /\ www.cyreksoft.yorks.com ]

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu