K
K
kaxa32012019-08-02 10:54:35
PostgreSQL
kaxa3201, 2019-08-02 10:54:35

What format to store nanoseconds values ​​in?

Please tell me in what type of field to write nanoseconds in postgresql.
And tell me how can I write data to the database in nanoseconds in laravel?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
1
1210mk2, 2019-08-02
@1210mk2

a normal timestamp will do.
through Carbon we get any format

G
Grigory Vasilkov, 2019-08-02
@gzhegow

seconds is an integer part, the rest is a fractional part. what could be wrong with that?
normal decimal, no?
turning it into a string and splitting it by a point, you can work with it using bcmath and immediately see that here are seconds, here are nano.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question