summary refs log tree commit diff stats
path: root/lib/pure/times.nim
Commit message (Collapse)AuthorAgeFilesLines
* Fixed compilation of times.nim with mingw 4.9.2 C++ 32bitYuriy Glukhov2018-04-031-3/+6
|
* Comparing datetimesdata-man2018-04-011-0/+12
|
* Remove repetitive index checks in b30b9207510a62b.Dominik Picheta2018-02-191-139/+67
|
* Fix date parsing for a bad inputsdata-man2018-02-191-59/+139
|
* Merge pull request #7033 from GULPF/allow-timezone-closuresDominik Picheta2018-01-101-2/+2
|\ | | | | Allow timezone procs to be closures
| * Remove nimcall pragma from tz procsOscar Nihlgård2018-01-051-2/+2
| |
| * Allow timezone procs to be closuresOscar Nihlgård2018-01-051-2/+2
| |
* | Unexport epochday procs (#7024)GULPF2018-01-031-2/+2
|/
* Improve deprecation comments in times moduleGULPF2017-12-311-3/+6
|
* Add warnings about deprecation to times module (#7001)Daniil Yarancev2017-12-301-2/+12
| | | | | | | | | | | * Add warnings about deprecation to times module I've added warnings about some procedures being deprecated. Also I can't find what is the replacement for `getTimezone` proc, please help with that * Update times.nim * Update times.nim
* cleanup times.nimAraq2017-12-211-8/+7
|
* Better times module (#6552)GULPF2017-12-181-730/+801
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * First work on better timezones * Update tests to new api. Removed tests for checking that `isDst` was included when formatting, since `isDst` no longer affects utc offset (the entire utc offset is stored directly in `utcOffset` instead). * Deprecate getLocaltime & getGmTime * Add `now()` as a shorthand for GetTIme().inZone(Local) * Add FedericoCeratto's timezone tests (#6548) * Run more tests in all timezones * Make month enum start at 1 instead of 0 * Deprecate getDayOfWeekJulian * Fix issues with gc safety * Rename TimeInfo => DateTime * Fixes #6465 * Improve isLeapYear * FIx handling negative adjTime * Cleanup: - deprecated toSeconds and fromSeconds, added fromUnix and toUnix instead (that returns int64 instead of float) - added missing doc comments - removed some unnecessary JS specific implementations * Fix misstake in JS `-` for Time * Update usage of TimeEffect * Removed unecessary use of `difftime` * JS fix for local tz * Fix subtraction of months * Fix `days` field in `toTimeInterval` * Style and docs * Fix getDayOfYear for real this time... * Fix handling of adding/subtracting time across dst transitions * Fix some bad usage of the times module in the stdlib * Revert to use proper time resoultion for seeding in random.nim * Move deprecated procs to bottom of file * Always use `epochTime` in `randomize` * Remove TimeInterval normalization * Fixes #6905 * Fix getDayOfWeek for year < 1 * Export toEpochDay/fromEpochDay and change year/month/monthday order * Add asserts for checking that the monthday is valid * Fix some remaining ambiguous references to `Time` * Fix ambiguous reference to Time
* 'ord' does not produce a range type anymoreAndreas Rumpf2017-11-021-2/+2
|
* Fix countLeapYearsOscar Nihlgård2017-10-101-1/+1
|
* fixes to allow the usage of clang on windows with the msvc abi and ms ↵Charlie Barto2017-10-091-10/+5
| | | | headers (#6442)
* Call tzset to initialize timezone (#6466)GULPF2017-10-031-0/+2
|
* Improve TimeInterval docs #6135 (#6341)Federico Ceratto2017-09-071-8/+20
|
* Improve docs around subtracting times (#6152)Federico Ceratto2017-09-031-0/+12
| | | The output can be surprising - better provide examples.
* Add TimeInterval reversing docstringFederico Ceratto2017-07-291-0/+5
|
* fixes #6021!Araq2017-06-271-43/+53
|
* Fix #6010 documenting subtracting time interval (#6012)Euan T2017-06-221-1/+1
|
* Update times.nimDaniil Yarancev2017-06-181-1/+1
|
* Linux abi take 3 (#5692)Jacek Sieka2017-04-121-10/+24
| | | | | * avoid generating object fields for imported types * fix some abi/type issues for linux_amd64
* Stdlib: Times: Use JS's "new Date" to convert TimeInfo to Time.Konstantin Molchanov2017-03-291-260/+253
| | | | To use JS's Date creation from string, I moved the TimeInfo formatting code above the toTime proc declaration. Also, I changed the argument type for newDate from string to cstring for it to work.
* Merge branch 'calculate_yearday_in_timeinfo_js' into fix_time_offset_in_times_jsKonstantin Molchanov2017-03-271-2/+8
|\
| * Times: JS: Add yearday to TimeInfo.Konstantin Molchanov2017-03-271-2/+8
| | | | | | | | | | | | Add yearday calculation to getLocalTime and getGMTime, so that yearday is not 0 for TimeInfo instances under JS backend. Yearday 0 has no sense and contradicts the behaviour under C backend, where yearday is an int from 1 to 365, i.e. cannot be 0 even theoretically.
* | Times: JS: Remove implicit UTC convesion.Konstantin Molchanov2017-03-261-1/+1
|/ | | | The conversion would produce incorrect timestamp.
* JS: Times: Add timezone prop to TimeInfo. (#5581)Konstantin Molchanov2017-03-251-0/+1
|
* fixes 4804Simon Krauter2017-01-061-10/+4
| | | toTime(): Use the Windows-specific part for every OS, because it gives correct results on Linux too. The removed code for Linux gives wrong results.
* bcc uses _timezone like vccAdrianV2016-12-281-1/+1
|
* Merge branch 'devel' into sighashesAraq2016-12-061-6/+18
|\
| * Revert @endragor's fix for WindowsDmitry Polienko2016-12-061-14/+16
| | | | | | | | | | | | | | | | | | _mkgmtime is not supported by mingw because of the older msvcrt versions. Fortunately, mktime implementation in Windows is just broken enough to make the initial implementation work... As far as I can tell, this works with both *nix-like platforms and Win, and fixes #4690
| * Fix TimeInfo to Time conversion. Fixes #5065.Ruslan Mustakov2016-11-301-10/+15
| |
* | times.nim: remove code duplicationAraq2016-11-291-8/+2
|/
* Updated times.parse() documentationFelix Krause2016-11-141-3/+6
|
* Parse 'Z' as valid timezone if offset is expectedFelix Krause2016-11-141-3/+15
|
* Assume local DST iff no timezone is givenFelix Krause2016-11-141-3/+16
|
* Improved `-`; fixed testsFelix Krause2016-11-141-18/+15
| | | | | | * added prefix `-` operator for TimeInterval * improved `-` for both TimeInterval and TimeInfo * Fixed a DST test
* Fixed daylight saving timeFelix Krause2016-11-141-19/+16
| | | | | | | | | * 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
* Fixed timezone rendering, added testFelix Krause2016-11-101-4/+5
|
* Fixed timezone sign errorFelix Krause2016-11-081-6/+6
| | | | | * This was introduced in recent "cosmetic" fix. Not so cosmetic after all…
* Merge pull request #5002 from goldenreign/time-compare-nosideeffectAndreas Rumpf2016-11-071-5/+5
|\ | | | | Add 'noSideEffect' pragma for Time type's operators. Fixes #4981
| * Fix `-` operator for Time type for JS targetgoldenreign2016-11-071-1/+1
| |
| * Add 'noSideEffect' pragma for Time type's operatorsgoldenreign2016-11-071-4/+4
| |
* | More cosmetic changesFelix Krause2016-11-071-20/+11
| | | | | | | | | | | | * Don't use factor var, it's overly complicated * Removed proc that's now unused * Better documented timezone field
* | Cosmetic fixesFelix Krause2016-11-031-16/+17
| | | | | | | | | | | | * Improved comments * Improved spacing * Use consts instead of magic numbers
* | Use ISO 8601 format for times.`$`. Fixed tests.Felix Krause2016-11-011-46/+36
| | | | | | | | | | | | * `$` now uses format() with explicit time zone. * Fixed errors in rendering "z", "zz" and "zzz" * Updated tests
* | Removed tzname because it's brokenFelix Krause2016-11-011-32/+2
| | | | | | | | | | | | | | * 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
* | Fixed timezone offset parsingFelix Krause2016-11-011-10/+12
| |
* | Made times.nim compile again to JSFelix Krause2016-11-011-2/+1
| |