Is there any direct datatype in eosio to store date? and if not then how can we store dates in eosio table?

void mainloan::paymentConfirm(uint64_t pay_id,uint64_t pay_date,double pay_amunt,name from ,uint64_t loan_id){ require_auth(_self);

payMade_table.emplace(get_self(),[&](auto &p){ p.pay_id=payMade_table.available_primary_key(); p.pay_date=pay_date; p.pay_amunt=pay_amunt; p.pay_from=from; p.loan_id=loan_id; });


Yes. You can either convert the data to a uint64_t as you have showed above, or you can use the time_point types:


I believe of the above, time_point_sec is likely most common. time_point_sec is a lower resolution timestamp accurate to seconds.

time_point_sec format:

yyyy-MM-dd T HH:mm:ssz

time_point format:

yyyy-MM-dd T HH:mm:ss.SSSSSSz

List of Available EOS Datatypes


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.