Re: HELP WITH DATES
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 10454
interpreted = N
texte = >The [math] context now understands how to work with dates and we're trying>to decide what the standard behavior should be. Please let us know how you>feel on these various options:>Note: Dates are automatically detected in the math context as long as they>are in the following form
//.Will it be able to deal with my preferred YEAR/MONTH/DAY format (as in1997/04/23) instead of just understanding MONTH/DAY/YEAR?>1. dates are automatically converted to an integer value (days since 1/1/0)>and then added, subtracted, etc. This means that if you add 0/0/1 to todays>date you will really be adding 365 days which may not give you todays date>a year from now because of leap years. However, it does let you easily>subtract two dates to get the days between them so they can be used for an>input somewhere else. The result of the math will be an integer value that>you can convert back to a date using the [format] context (with a parameter>of days_to_date: [format days_to_date][math]...[/math][/format].>>2. if any date is detected in the math context ...How is it going to detect whether or not there's a date in the mathcontext? In other words, what's it looking for that makes it decide thatit's dealing with a date instead of a text string? Just the slashes? Or twoslashes separated by two other characters? or ???>then the entire expression>will be evaluated and output as a date. That is, you can add 12/8/65+0/0/31>and you will get 12/8/96 regardless of leap years. And, the result of the>math expression will be 12/8/96 so there is no need to wrap the [format]>context around it. However, if you want to subtract two dates to get the>number of days between them you will need to format the date as days (for>example [format date_to_days][math]...[/math][/format]). Also, any integers>in the expression will be assumed to be days and handled appropriately.I dunno, this takes a lot of thinking, and I'm not sure I can do that today... :)Sincerely,Ken------------------------------------To leave this talk list send an email to macjordomo@smithmicro.comwith BODYunsubscribe WebDNA-Talk------------------------------------
Associated Messages, from the most recent to the oldest:
>The [math] context now understands how to work with dates and we're trying>to decide what the standard behavior should be. Please let us know how you>feel on these various options:>Note: Dates are automatically detected in the math context as long as they>are in the following form //.Will it be able to deal with my preferred YEAR/MONTH/DAY format (as in1997/04/23) instead of just understanding MONTH/DAY/YEAR?>1. dates are automatically converted to an integer value (days since 1/1/0)>and then added, subtracted, etc. This means that if you add 0/0/1 to todays>date you will really be adding 365 days which may not give you todays date>a year from now because of leap years. However, it does let you easily>subtract two dates to get the days between them so they can be used for an>input somewhere else. The result of the math will be an integer value that>you can convert back to a date using the [format] context (with a parameter>of days_to_date: [format days_to_date][math]...[/math][/format].>>2. if any date is detected in the math context ...How is it going to detect whether or not there's a date in the mathcontext? In other words, what's it looking for that makes it decide thatit's dealing with a date instead of a text string? Just the slashes? Or twoslashes separated by two other characters? or ???>then the entire expression>will be evaluated and output as a date. That is, you can add 12/8/65+0/0/31>and you will get 12/8/96 regardless of leap years. And, the result of the>math expression will be 12/8/96 so there is no need to wrap the [format]>context around it. However, if you want to subtract two dates to get the>number of days between them you will need to format the date as days (for>example [format date_to_days][math]...[/math][/format]). Also, any integers>in the expression will be assumed to be days and handled appropriately.I dunno, this takes a lot of thinking, and I'm not sure I can do that today... :)Sincerely,Ken------------------------------------To leave this Talk List send an email to macjordomo@smithmicro.comwith BODYunsubscribe WebDNA-Talk------------------------------------
Kenneth Grome
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:
two unique banners on one page (1997)
WebCat2 Append problem (B14Macacgi) (1997)
Emailer (1997)
remotely creating and populating a stock inventory db -almostthere! (1999)
I give up!! (1997)
[WebDNA] [BULK] WebDNA AJAX example wanted! (2010)
tcpconnect/tcpsend frustrations (2002)
[WebDNA] Comparisons in "if" and "case" statements (2010)
Safe command=append (1999)
MasterCounter Weirdness -Resolved! (1997)
Local redirects ... (2005)
[Cart] ... (1997)
OT: Windows Media/Real Media (2001)
Limiting user access to .tmpl files (1997)
Electronic Delivery (1997)
WebTen and WebCat (1997)
[WebDNA] WebDNA Roll Call (2014)
Listfiles on network with NT (2000)
ooops...WebCatalog [FoundItems] Problem - LONG - (1997)
WebCat2.0 [format thousands .0f] no go (1997)