bjtc_bd

Function bjtc_bd 

Source
pub fn bjtc_bd(text: &str) -> Result<NaiveDate, MoreError>
Expand description

bjtc_xy: Conversion between various expressions of Beijing time, x -> y

§Conversion type

x,y is one of d,t,s,f,n

d: NaiveDate

t: NaiveDateTime

s: %Y-%m-%d or %Y-%m-%d %H:%M:%S

f: timestamp float

n: timestamp integer

§Usage

use python_comm::use_basic::*;

let ts = bj_timestamp();
let a = bjtc_nt(ts, 10).unwrap();
let b = bjtc_ts(&a);
let c = bjtc_st(&b).unwrap();
let d = bjtc_tf(&c);
assert_eq!(d as i64, ts);