Skip to main content

new_timestamp

Function new_timestamp 

Source
pub fn new_timestamp(nanoseconds: J) -> K
Expand description

Constructor of q timestamp from elapsed time in nanoseconds since kdb+ epoch (2000.01.01). Relabeling of ktj.

use kdbplus::api::*;

#[no_mangle]
pub extern "C" fn create_timestamp2(_: K) -> K{
  // 2015.03.16D00:00:00:00.000000000
  new_timestamp(479779200000000000)
}
q)stamp: `libapi_examples 2: (`create_timestamp2; 1);
q)stamp[]
2015.03.16D00:00:00.000000000