Re: date pref
This WebDNA talk-list message is from 1999
It keeps the original formatting.
numero = 24035
interpreted = N
texte = >>>>>I think you should change the Read date format, too.>>>>>>i also did that Ken. Quit W* and diit with BBEdit.Still no joy.>>>>A long time ago I changed over to storing my dates as the number of days>>since 0000. Now when I make date comparisons, I'm comparing numbers, not>>formatted date values, so the comparisons are far faster than ever before>>-- and they always work as expected. Formatting dates on the page is done>>on the fly wherever needed.>>Well that is fine Ken but what if you are given a database with a date>field already in the form of dd/mm/yyyy. How do you convert a 3000 odd .db>to number of days since 0000?:-))M#237#che#225#l, let's assume your db is named xxx.db ... and that the fieldDate field is the one that's currently storing your dates in your dd/mm/yyyy format ... and you have a sku field in that db with a unique value in it for each record in the db. This is how I would do it:1- Quit webcat.2- Make a copy of your db for backup, just in case ...3- Change your DateFormat pref to %m/%d/%Y via BBEdit.4- Change your ReadDateFormat pref to mdy via BBEdit.5- Launch webcat.6- Run this webdna code ONLY ONCE:[search db=xxx.db&neskudatarq=[blank]][founditems][replace db=xxx.db&eqskudatarq=[sku]]fieldDate=[math]{[getchars start=4&end=6][fieldDate][/getchars][getchars start=1&end=3][fieldDate][/getchars][getchars start=7&end=10][fieldDate][/getchars]}[/math][/replace][/founditems][/search]Sincerely,Kenneth GromeWebDNA Consultant
Associated Messages, from the most recent to the oldest:
>>>>>I think you should change the Read date format, too.>>>>>>i also did that Ken. Quit W* and diit with BBEdit.Still no joy.>>>>A long time ago I changed over to storing my dates as the number of days>>since 0000. Now when I make date comparisons, I'm comparing numbers, not>>formatted date values, so the comparisons are far faster than ever before>>-- and they always work as expected. Formatting dates on the page is done>>on the fly wherever needed.>>Well that is fine Ken but what if you are given a database with a date>field already in the form of dd/mm/yyyy. How do you convert a 3000 odd .db>to number of days since 0000?:-))M#237#che#225#l, let's assume your db is named xxx.db ... and that the fieldDate field is the one that's currently storing your dates in your dd/mm/yyyy format ... and you have a sku field in that db with a unique value in it for each record in the db. This is how I would do it:1- Quit webcat.2- Make a copy of your db for backup, just in case ...3- Change your DateFormat pref to %m/%d/%Y via BBEdit.4- Change your ReadDateFormat pref to mdy via BBEdit.5- Launch webcat.6- Run this webdna code ONLY ONCE:[search db=xxx.db&neskudatarq=[blank]]
[founditems][replace db=xxx.db&eqskudatarq=[sku]]fieldDate=
[math]{[getchars start=4&end=6][fieldDate][/getchars][getchars start=1&end=3][fieldDate][/getchars][getchars start=7&end=10][fieldDate][/getchars]}[/math][/replace][/founditems][/search]Sincerely,Kenneth GromeWebDNA Consultant
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:
Search in 2 or more catalogs (1997)
searchable list archive (1997)
Customer login feature (2004)
I can help! (1996)
Error Log.db --however (1997)
PIXO support (1997)
Mozilla/4. and Browser Info.txt (1997)
Re:Emailer and encryption (1997)
WebCat2: multiple currency support (1997)
WebCat2 - [SendNews] (1997)
Still Stumped on ShowNext...HELP! (1997)
E-mail Attachments (1997)
checksum for credit cards? (1997)
IE Cache Problems... (1999)
Windows version Trouble Shooting (2007)
Associative lookup style? + bit more (1997)
Newbie questions (1999)
Major Security Hole IIS NT (1998)
OT - good CC processor(s)? (1999)
Quit revisited (1997)