On 3/1/07, Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
> opted for it after a length discussion.   Storing the date/time as a
> string in the ISO 8601 format is forced and allows you to export data
> to another application without having to try and guess the date format
> in the new application (yyyymmdd, ddmmyyyy, mmddyyyy, etc).

You don't need to guess if it's in the database native format ?

That wasn't our experience with MS SQL Server 2000 which uses the US
date/time format even though the server was installed in the UK with
UK regional settings. We had similar issues (can't remember exactly
what) with Firebird.  Hence the reason we now store it as strings.

"the user sees the date/time it the format they prefer."

"We opted to follow the ISO 8601recommendation for display as well"

Which one is it ? You can't have both :-)

hehe... ok reading my post again I can see it wasn't very clear.  ISO
8601 is a recommendation, it doesn't force anything.  The same goes
for the helper functions I wrote.

function tiDateTimeAsIntlDateStor(const ADateTime: TDateTime): string;
function tiDateTimeAsIntlDateDisp(const ADateTime: TDateTime): string;
function tiIntlDateStorAsDateTime(const AValue: string): TDateTime;
function tiIntlDateDispAsDateTime(const AValue: string): TDateTime;

After a length discussion in our company regarding previous versions
of our application, we had experienced a lot of confusion with date
formats.  Hence the reason we opted to force date formats when dates
get stored in a database, printed or displayed on the screen.
So yes, currently we don't give the user a choice.

However if somebody else had to use the functions above (part of the
tiOPF project) to read in a string date to TDateTime, it doesn't mean
they have to force the display format on their users.  Once the string
date/time is in a TDateTime variable and they use some GUI component
to display that value, it will default to whatever that computers
regional settings are set at. Standard Delphi/Lazarus behaviour.


> Is 02-06-2002 the 2nd June or is it 6th Feb?  So when is the deadline
> for the multi-million dollar contract? :-)  If it uses the ISO 8601
> format yyyy-mm-dd there is no confusion, hence the reason we opted for
> that format in our applications (display on screen and paper and in
> storage).

So, the user has no choice... ?

In our case and in our application, no.  We are a franchise
organisation and this policy was dictated by head office.


--
Graeme Geldenhuys

There's no place like S34° 03.168'  E018° 49.342'

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

Reply via email to