更新当前时间戳加上x天数

时间:2019-03-22 21:14:39

标签: postgresql

如果我有一列membership_expiry_date TIMESTAMP(PostgreSQL),并且想要获取当前的到期日期并添加3天,我将如何编写此查询

UPDATE users SET membership_expiry_date = ??

如何检索当前值并将其添加?

1 个答案:

答案 0 :(得分:1)

<body>
  <!--section for controlling & displaying round timer-->
  <div name="timeLeft" id="D3">
    Round Timer<br> Hours:
    <select name="hours" id="S1">
      <option value="0">0</option>
      <option value="1">1</option>
      <option value="2">2</option>
    </select>
    Minutes:
    <select name="minutes" id="S2">
      <option value="0">0</option>
      <option value="5">5</option>
      <option value="10">10</option>
      <option value="15">15</option>
      <option value="20">20</option>
      <option value="25">25</option>
      <option value="30">30</option>
      <option value="35">35</option>
      <option value="40">40</option>
      <option value="45">45</option>
      <option value="50">50</option>
      <option value="55">55</option>
    </select>
    <br>
    <input type="button" name="countDownStart" id="B2" onclick="countDown()" value="Start Countdown">
    <br> Your round will end in <span name="timerDisplay" id="span1">00:00:00</span>
  </div>
</body>