Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    7

    Unanswered: current date problem

    Hi all,
    I'm trying to store the current date in a DATE column using "date(current timestamp)", but when I retrieve it, the hour, minute and second are being lost. I get, for example, 26/10/1978 00:00. What's wrong?

    Thanx in advance.
    giazzon

  2. #2
    Join Date
    Nov 2002
    Location
    Rio de Janeiro - Brazil
    Posts
    78

    Re: current date problem

    Hey Giazzon,

    Are you sure that your column datatype is DATE? Because the Date datatype won´t store the hours and minutes of the records.

    If your column is indeed Date, try using the command "current date", instead of "current timestamp". This will prevent you from casting types unnecessarily. And note that this way, you won´t have the hour, minutes and seconds.

    But if you wish to hold the hour, minutes and seconds, define your column type as "TIMESTAMP" and don´t use the function "date()", which will cause the loss of that information.

    HTH
    Fernando

    Originally posted by giazzon
    Hi all,
    I'm trying to store the current date in a DATE column using "date(current timestamp)", but when I retrieve it, the hour, minute and second are being lost. I get, for example, 26/10/1978 00:00. What's wrong?

    Thanx in advance.
    giazzon

  3. #3
    Join Date
    Jan 2003
    Posts
    7

    Re: current date problem

    Fernando,
    I was really using the DATE datatype. Actually I'm used to Oracle, so I guess it will take a time to catch all the differences, like TIMESTAMP.

    Thanks!
    Giovanni Giazzon

    postei em inglês pq sei que muitos gostam de acompanhar as discussões...
    um abraço

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •