"Sam Carleton" <[email protected]>
wrote in message
news:[email protected]
> I am using julianday('now') to set the insertedon date to my tables.
> The value needs to be returned to the client via Web Service so that
> the client and return it later to get the next inserted record. I am
> currently returning it as a double, somewhere along the way it is
> getting trunkated:
>
> From 2454976.5929914005 to 2454976.592991
Are you using sprintf("%f"), by any chance? Default precision is 6
fractional digits.
Note that a double can accurately represent 15 decimal digits, so you
are not losing all that much. But you do need 8 fractional digits if you
want millisecond accuracy.
> How best to solve this issue? I am thinking it is best to convert to
> a string format for transport via Web Service and convert back to the
> native format for the next select. My option problem is I cannot make
> heads or tails of how to convert the double into
> YYYY-MM-DDTHH:MM:SS.SSS and back.
select strftime('%Y-%m-%dT%H:%M:%f', 2454976.5929914005)
2009-05-25T02:13:54.457
select julianday('2009-05-25T02:13:54.457')
2454976.5929914
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users