benonymus
Timex.Timezone.convert/2 question
Hey I am using this function, and the result does only show until the seconds, doesn’t show milliseconds, not even the .000000. Why is that?
Before it did show it.
It used to return this:
2018-09-15T15:00:00.000000+02:00
and now it returns this:
2018-03-10T05:00:00-04:00
I am using timex 3.4
Marked As Solved
benonymus
ok so at the end I used Timex.set/2 and setting the microsecond field
Also Liked
NobbZ
Then please use proper formatting instead of relying on debug output that may change without a warning at any point in time.
NobbZ
If you want to format a time for presentation use Timex.format, the inspection output is for debugging only and might change its presentation without any warnings.
OvermindDL1
Hmm, as per the documentation I linked I don’t see why this wouldn’t work for you based on the information given?
iex(1)> Timex.format(DateTime.from_unix!(1549385336000000, :microsecond), "%FT%T.%f%z", :strftime)
{:ok, "2019-02-05T16:48:56.000000+0000"}
iex(2)> Timex.format(DateTime.from_unix!(1549385336000001, :microsecond), "%FT%T.%f%z", :strftime)
{:ok, "2019-02-05T16:48:56.000001+0000"}
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #code-sync
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








