FAQ
Hi all.
I am using Postgres 8.3 with Windows XP Pro.
System date format is dd/MM/yyyy

Having problems when I writing records to a database with a single
'date' type field.

e.g. FieldByName('Date').ASString:='2/2/2003'

When the row is viewed in pgAdmin it is always 1899-12-30

I have tried changing the datestyle in postgresql.conf thus:

datestyle='iso,dmy'
datestyle='dmy'
datestyle='ymd'
datestyle='European'

also

lc_time= 'English_Australia.1252'

(obviously stopping and starting Server)


Nothing seems to make any difference.
Who has got an answer to this.

Also thanks to Craig Ringer and others for answering my earlier
questions, it greatly helped me get up and running with postgres.

Search Discussions

  • Klint Gore at Jul 3, 2008 at 5:42 am

    J Ottery wrote:
    Hi all.
    I am using Postgres 8.3 with Windows XP Pro.
    System date format is dd/MM/yyyy

    Having problems when I writing records to a database with a single
    'date' type field.

    e.g. FieldByName('Date').ASString:='2/2/2003'
    What is delphi's ShortDateFormat set to?

    Does fieldbyname('Date').asdatetime := strtodate('2/2/2003') make any
    difference?

    klint.

    --
    Klint Gore
    Database Manager
    Sheep CRC
    A.G.B.U.
    University of New England
    Armidale NSW 2350

    Ph: 02 6773 3789
    Fax: 02 6773 3266
    EMail: kgore4@une.edu.au
  • Artacus at Jul 3, 2008 at 3:04 pm

    J Ottery wrote:
    Hi all.
    I am using Postgres 8.3 with Windows XP Pro.
    System date format is dd/MM/yyyy

    Having problems when I writing records to a database with a single
    'date' type field.
    I may be confused here. You say writing was your problem but it sounds
    like the problem is when you read the records out.

    The way dates are displayed is dependent on (and configured in) the
    client not on the server. So if you have a specific format you want your
    dates displayed then you need to convert them to a string in your query.

    Artacus

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-general @
categoriespostgresql
postedJul 3, '08 at 3:27a
activeJul 3, '08 at 3:04p
posts3
users3
websitepostgresql.org
irc#postgresql

3 users in discussion

J Ottery: 1 post Artacus: 1 post Klint Gore: 1 post

People

Translate

site design / logo © 2021 Grokbase