What is an appropriate data type to store a timezone?

后端 未结 5 1889
情深已故
情深已故 2021-02-03 22:55

I\'m thinking of simply using a string in the format \"+hh:mm\" (or \"-hh:mm\"). Is this both necessary and sufficient?

Note: I don\'t need to store the date or the time

5条回答
  •  鱼传尺愫
    2021-02-03 23:13

    maybe interval

    postgres=# select interval '01:30';
     interval 
    ----------
     01:30:00
    (1 row)
    
    postgres=# select interval '-01:30';
     interval  
    -----------
     -01:30:00
    (1 row)
    

提交回复
热议问题