Date Data Type

From CometWiki

Jump to: navigation, search

Proposals for Date Data Type

Jim suggested we do this on the Wiki, hence I have set this up as a test.

I have cut and pasted everyones comments onto the discussion page.

Traditionally on a Wiki this page would have suggested syntax or protocols for date handling, which anyone can edit - adding their ID of course (4~'s).

Discussion takes place on the Discussion page. This seems a little unwieldy to me, but at least it keeps all the discussion in the one place.

Google Wave would appear to me to be a step in the right direction for this type of collaboration.

If you haven't watched the demo I recommend it, and not just because it was done in Sydney, Australia.


Actual Proposal.

I believe that all most people want is a simple way of storing dates in their files, in a standard format, and then being able to print them in a different format to that in which they are stored.

Consequently I think there should be a data type which is dates, a special character on the end of a field name ?, why not, we all understand that concept.

All date records will be of a fixed size and format. Why Not YYYYMMDDHHMMSS. No need to specify a length as it will be constant for any defined date field.

As any instructions that operate on these date fields will be new, then to incorporate them into our programs we need the SOURCE CODE. If you don't have the source code you cant utilise the features.

Once all date fields are in a set format, reformatting of them is a simple matter, either using PROCS in your programs or new instructions within Comet.

As a large degree of the impetus for these changes would appear to be coming from RPG users, whatever is utilised needs to work in Comet and RPG. - Which would make me think new instructions rather than Procs.

Then printing a report with a date in US format would grab it with something like Print_date=Datefieldname(1),

. UK format Print_date=Datefieldname(2),

. Other format Print_date=Datefieldname(3)

. Comet would now from the special character on the field name that the field was a date and would perform the appropriate manipulation to present the date correctly. . If you need to do some arithmetic on a date, say 15 days interest free,

then we merely say interest_start_date=Purchase_date + 15.

Comet knows that this is date arithmetic so converts the date to Julian or date serial or whatever, does the arithmetic and gives us back a date - in our standard date format.

Same logic if you want to know elapsed time , we just ask it to do maths and it does it. Elapsed_days=Datefield1-datefield2.

Frankly, we don't care how Comet woman does it, so long as she enjoys the music.

Personal tools