Comments (3)
I'll try and get to this one tonight. For future reference though, you should never use erlang:now
unless you require monotonic timestamps, as erlang:now
will always increase the system timestamp, and requires a global lock to read. You should use os:timestamp
instead, which does not have those caveats.
In general, the Time
module is the one which cares about fractional seconds, but I'll fix Date to make use of the microseconds when creating DateTimes from a timestamp, so you should be able to do Time.now |> Date.from(:timestamp)
. I'll follow up here once that's ready for you to test.
from timex.
Thanks for looking at this. Now that you mention it I do have some vague recollection of that issue with erlang:now but I'm pretty sure I didn't know about os:timestamp... so thanks again :-)
from timex.
Fix for this is pending merge of #19.
from timex.
Related Issues (20)
- `Timex.from_now` unexpected result
- to_datetime without time zone no longer converts DateTime to UTC HOT 1
- Failing tests (Elixir 1.13) HOT 1
- Half-hour negative timezone formatting
- Start of day fails to handle change from daylight saving HOT 1
- `Timex.from_now` rounds up to minute after 45 seconds
- Timex.shift/2 with time-shift always converts precision to :microsecond in Elixir v1.14+ HOT 2
- Timex.format seems off at the end of the month
- Gettext warnings because some translation files specify nplurals without rules HOT 4
- Translation is missing plural form 1 which is required by the locale "id" HOT 1
- Error handling conversions which land in a > 4 digit year HOT 2
- set/2 : Pre parse/sort options to prevent wrong date creation HOT 1
- Inconsistency in `shift/2` with months, years HOT 2
- Can Timex parse a relative string into a DateTime? HOT 1
- `Timex.format/2` Wrong week number when using Wsun or %U HOT 1
- Timex.parse for {Zabbr} not working
- Beginner on Timex HOT 1
- Typo + Incorrect Info in strftime.ex
- Cant compile timex on a project with gettext configured HOT 1
- Timex.from_now is wrong when multiple days in the future / Might be timezone related, not sure
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timex.