CURRENT_TIMESTAMP correct usage

Discussion in 'ISPConfig 3 Priority Support' started by pyte, Feb 16, 2023.

  1. pyte

    pyte Well-Known Member HowtoForge Supporter

    Hi,
    trying to add some DNS records via the API. In my array i set 'stamp' to 'CURRENT_TIMESTAMP' but it results in a error.
    Code:
      $params = array(
            'server_id' => $record['server_id'],
            'zone' => $record['zone'],
            'name' => '',
            'type' => 'mx',
            'data' => 'xxxxxxxxxx.',
            'aux' => '20',
            'ttl' => '3600',
            'active' => 'y',
            'stamp' => 'CURRENT_TIMESTAMP',
            'serial' => '1',
        );
    Code:
    SOAP Error: Incorrect datetime value: 'CURRENT_TIMESTAMP' for column ...
    How do use the mysql CURRENT_TIMESTAMP correctly? The documentation examples all do it exactly like in my code above.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You must set an actual date timestamp e.g. using php date function.
     
    pyte likes this.
  3. pyte

    pyte Well-Known Member HowtoForge Supporter

    Alright thats what i thought of. So

    Code:
    $date = date("Y-m-d H:i:s");
    ...
    'stamp' => $date
    ...
    should do the trick then. Thank you for clearing it up, thought i may be built it somewhere :)
     

Share This Page