| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
* added prefix `-` operator for TimeInterval
* improved `-` for both TimeInterval and TimeInfo
* Fixed a DST test
|
|
|
|
|
|
|
|
|
| |
* When formatting timezone, substract 1 hour from timezone when isDST
* Do not depend DST in current timezone when parsing arbitrary date
because formatted timestamps are never in DST.
* On the way, removed an unnecessary line in parsing code which could
cause bugs.
* Added DST tests
|
| |
|
|\
| |
| | |
Add 'noSideEffect' pragma for Time type's operators. Fixes #4981
|
| | |
|
| |
| |
| |
| |
| |
| | |
* `$` now uses format() with explicit time zone.
* Fixed errors in rendering "z", "zz" and "zzz"
* Updated tests
|
|/
|
|
|
|
|
| |
* No mapping between TimeInfo.tzname and TimeInfo.timezone
* tzname of time.h is not well-defined, may have almost arbitrary
length, and localization may differ
* Code used hardcoded "UTC" string
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`initInterval` had logic to calculate and carry overflowed fields (65 seconds
turns into 5 seconds and carries 1 minute). However, we were not including that
carried value when we recalculate the carry over for the next period of time.So
if you had, for example, 3600 seconds, we carried 60 minutes into the minutes
calculation, but when we calculated how much we should carry into the hours
value we only considered what the user originally supplied for the minutes
field, and forgot to include those 60 carried minute.
So, for example, with the previous implementation this was true:
`seconds(60 * 60 * 24) == seconds(0)`
Or, as failing tests:
```nimrod
import times
assert seconds(60 * 60 * 24) != seconds(0)
assert seconds(60 * 60 * 24) == days(1)
```
|
|
|
|
|
|
|
| |
* Added check for yearday
* Changed some test dates to check different equivalence classes of
yearday (before leap day, at leap day, after february in leap year,
after february in non-leap year)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
add tests to ttime.nim for timeinterval add/subtract functionality
Changed assert to doAssert in ttime.nim
Added extra tests to ttime.nim
Removal of singular help procs for working with TimeIntervals
Added TimeIin proc toSeconds(a: TimeInfo, interval: TimeInterval) where subtracting a year gave wrong results
Add overflow of units on initInterval eg, 65 seconds is 5 seconds and 1 minute
|
| |
|
|
|
|
| |
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
|
|
|