1. Aaron Anbu Johan Abraham
  2. PowerBuilder
  3. Tuesday, 19 January 2021 15:51 PM UTC

Hi Team,

I have date field value but database has Timestamp format. This is existing application so not interested to disturb it. It is ok to set time field as 0's. Please let me know how to convert date field to timestamp one

 

Thanks,

Aaron

Accepted Answer
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 19 January 2021 16:43 PM UTC
  2. PowerBuilder
  3. # Permalink

It all depends on which database you are using. You might get away with setting some dbparm parameter or you might be able to write a trigger that converts the datetime to a timestamp before recording the value in the database.

Are you saying that setting them all to NULL also would be a valid option?

regards,

Comment
  1. mike S
  2. Tuesday, 19 January 2021 18:37 PM UTC
TIMESTAMP in some databases is a date/time format that may or may not have timezone information;

in other databases (sql server) it is as chris says, just a unique(ish) identifier that has nothing to do with a date or time
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 19 January 2021 17:30 PM UTC
  2. PowerBuilder
  3. # 1

Hi Aaron;

  AFAIK: The TIMESTAMP datatype has nothing to do with a date and time!  It's just a hexadecimal representation of an 8 byte integer for most DBMS. Thus, these values are not convertible back & forth.

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.