[WebDNA] linux fix for date to day of week

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 101699
interpreted = N
texte = Aloha all, I wrote a function so folks on Linux that need to get the day of week from any date (after 1582 or something like that at least) can use this function. Should be easy to modify for your needs. All other platforms, this function is not necessary. The Linux version has a bug with the day of week in the format days to date function. To use, just call the function and pass in the date you want to check like this [convertdate thisdate=[date]] Laters, Olin [function name=convertdate] [math]month=[Format Days_To_Date %m][math]{[thisdate]}[/math][/Format][/math] [math]year=[Format Days_To_Date %Y][math]{[thisdate]}[/math][/Format][/math] [math]day=[Format Days_To_Date %d][math]{[thisdate]}[/math][/Format][/math] [showif [month]<3] [math]month=month+12[/math] [math]year=year-1[/math] [/showif] [switch value=[math](day+(2*month)+floor(6*(month + 1)/10)+year+floor(year/4)-floor(year/100)+floor(year/400)+1)%7[/math]] [case value=0]  [return]Sun[/return] [/case] [case value=1] [return]Mon[/return] [/case] [case value=2]  [return]Tue[/return] [/case] [case value=3]  [return]Wed[/return] [/case] [case value=4]  [return]Thu[/return] [/case] [case value=5]  [return]Fri[/return] [/case] [case value=6]  [return]Sat[/return] [/case] [/switch] [return][/return] [/function] Associated Messages, from the most recent to the oldest:

    
  1. [WebDNA] linux fix for date to day of week ("Olin Lagon" 2008)
Aloha all, I wrote a function so folks on Linux that need to get the day of week from any date (after 1582 or something like that at least) can use this function. Should be easy to modify for your needs. All other platforms, this function is not necessary. The Linux version has a bug with the day of week in the format days to date function. To use, just call the function and pass in the date you want to check like this [convertdate thisdate=[date]] Laters, Olin [function name=convertdate] [math]month=[Format Days_To_Date %m][math]{[thisdate]}[/math][/Format][/math] [math]year=[Format Days_To_Date %Y][math]{[thisdate]}[/math][/Format][/math] [math]day=[Format Days_To_Date %d][math]{[thisdate]}[/math][/Format][/math] [showif [month]<3] [math]month=month+12[/math] [math]year=year-1[/math] [/showif] [switch value=[math](day+(2*month)+floor(6*(month + 1)/10)+year+floor(year/4)-floor(year/100)+floor(year/400)+1)%7[/math]] [case value=0]  [return]Sun[/return] [/case] [case value=1] [return]Mon[/return] [/case] [case value=2]  [return]Tue[/return] [/case] [case value=3]  [return]Wed[/return] [/case] [case value=4]  [return]Thu[/return] [/case] [case value=5]  [return]Fri[/return] [/case] [case value=6]  [return]Sat[/return] [/case] [/switch] [return][/return] [/function] "Olin Lagon"

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Is QuidProQuo dead? (1998) Webcat 3 Bug?!?! Netscape + Protect + Posted Form (1998) virtual domain service (1997) DB Size - MAX (2004) Range compare... (2000) Limit on nested [ShowIf]'s? (1997) Virtual hosting and webcatNT (1997) CommandSecurity? (1997) Re:Emailer and encryption (1997) [WebDNA] slideshow (2008) WebCatalog for guestbook ? (1997) Searchable list archive (1997) WebMerchant 1.6 and SHTML (1997) Help name our technology! I found it (1997) quantity minimum problem (1997) Emailer setup (1997) Return records from another (1997) [math] with first letter in field? (1997) Forumulas.db & Variables (2002) convertchars and e-mail (1998)