This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

date to day

Old posts that have not been replied to for several years.
Locked
M
Mad_Clog

date to day

Post by Mad_Clog »

im looking for a function that gives back the day name when u give the date.
eg: u give in 13/01/2004 and it gives back Tuesday
been looking for a while but cant seem to find anything :s

thnx in advance
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Re: date to day

Post by egghead »

Mad_Clog wrote:im looking for a function that gives back the day name when u give the date.
eg: u give in 13/01/2004 and it gives back Tuesday
been looking for a while but cant seem to find anything :s

thnx in advance
With [clock scan] convert the date to ticks. Read the following for the acceptable formats.

http://www.tcl.tk/man/tcl8.4/TclCmd/clock.htm#M43

Once you have the ticks, convert them to the name of the day with [clock format].

http://www.tcl.tk/man/tcl8.4/TclCmd/clock.htm#M6
M
Mad_Clog

Post by Mad_Clog »

got it, thnx a lot
[11:22:01] <Mad_Clog> .tcl set day [clock format [clock scan 2004-01-15] -format %A] ; return $day
[11:22:01] <Tester> 2 - result: Thursday - clicks: 69
Locked