On 6/7/06, Joost van der Sluis <[EMAIL PROTECTED]> wrote:
> International ISO 8601 date time format and use a string field to
> store the value.
> http://www.cl.cam.ac.uk/~mgk25/iso-time.html
>
> For storage we use:  yyyymmddThhmmss   eg:  20060606T230300
> For display we use:   yyyy-mm-dd hh:mm:ss   eg:  2006-06-06 23:03:00
I should use a TDateTime, which is a float.

Create the DB-fields as float's, store a TDateTime in it, and you're
done. Works on all databases and has support for '0'.

It's the same trick as you used, but you don't need to think of a
localisation-format and you don't need any special conversion-units...

Very clever, but I see one problem. 3rd Party tools will not be able
to figure out what the actual date is.  Why Borland decided on
1899-12-30 = 0 I have no idea, but that is only seen and known in
Delphi/FPC apps.

Using the ISO stardard everybody knows the date and date/time format
is not dependent on localisation.  Once the utility routines
(Encode/DecodeDate with extra error checking) convert then to
TDateTime, they can be displayed in any date format, though we still
stick to the ISO standard not to get confused with dates like
02-03-04.
Is that yy-mm-dd or mm-dd-yy, etc...?

Regards,
 Graeme.

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to