summary refs log tree commit diff stats
path: root/lib/pure/times.nim
Commit message (Collapse)AuthorAgeFilesLines
* [change] Replace mutators with their more generic versionsMichael Voronin2018-06-061-37/+22
|
* [add] Add fraction of seconds to parse/format utilsMichael Voronin2018-05-311-60/+75
|
* [add] add between function to calculate TI between two datetimesMichael Voronin2018-05-311-0/+103
|
* [add] Add procs for TimeInterval stringifyMichael Voronin2018-05-311-1/+34
|
* [add+change] Added toDurationParts proc to convert Duration to ↵Michael Voronin2018-05-311-22/+53
| | | | array[FixedTimeUnit, int64] of it's human-readable parts, use it in `$Duration`
* [doc] Standardize deprecation warningsMichael Voronin2018-05-101-8/+7
|
* [add] Add some wrappersMichael Voronin2018-05-101-0/+20
|
* [refactoring] Rearrange functions for better readability/usageMichael Voronin2018-05-101-139/+155
|
* [doc] Add/modify some runnable examples for pure/timesMichael Voronin2018-05-101-36/+104
|
* [fix] Little fix for runnable example in pure/timesMichael Voronin2018-05-101-1/+1
|
* Merge pull request #7624 from skilchen/fix-issue7620Dominik Picheta2018-05-031-7/+15
|\ | | | | there is no hour 0 in am/pm time (see #7620)
| * there is no hour 0 in am/pm timeskilchen2018-04-161-7/+15
| |
* | times.nim: don't rely on zero terminatorAndreas Rumpf2018-04-291-47/+50
| |
* | Rename `Time.nanoseconds` to `nanosecond` (#7673)Oscar Nihlgård2018-04-251-30/+30
| | | | | | | | | | | | * Rename `Time.nanoseconds` to `nanosecond` * Fix bug with Duration comparision
* | Add `fromWinTime` and deprecate `unixTimeToWinTime`/`winTimeToUnixTime` (#7641)Oscar Nihlgård2018-04-191-13/+26
| |
* | Change type of `Timeval.tv_sec` to `posix.Time` (#7646)Oscar Nihlgård2018-04-181-1/+1
| |
* | allow stringification of DurationZero (#7625)skilchen2018-04-181-1/+3
| |
* | os.setLastModificationTime*(file: string, t: times.Time) (#7543)Hendrik2018-04-161-3/+5
|/ | | | | | | | | | | | | * add proc toFILETIME to winlean * add proc toWinTime to times * add proc setFileTime to winlean * openHandle with write access * add proc setLastModificationTime to os * moved epochDiff,rateDiff constants and proc toWinTime The constants were moved out of the when defined(JS) block so that they are alsways available in proc toWinTime. proc toWinTime was moved above the # Deprecated procs comment. Best new location seemed to be with the toUnix proc.
* Timeinterval optimization (#7608)Oscar Nihlgård2018-04-161-12/+37
| | | | | | * TimeInterval optimization * Fix typo in `$`(Duration)
* remove deprecated timeToTimeInfo; fixes #3678Andreas Rumpf2018-04-141-49/+12
|
* Sub second time resolution (#6978)Oscar Nihlgård2018-04-131-260/+634
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add deprecation warnings to recently deprecated procs * Fix bad usage of the times module * Introduce sub second resolution * Fix usage of C's time() * Switch to nanosecond resolution * Make Time & Duration opaque again and fix some errors * Change back to TimeInterval for shorthands * Fix JS test * Fix build error for windows * Undeprecate epochTime * Documentation and minor changes * Lots of bugfixes and doc comments * Attempt to make travis & appveyor green * Fix edge cases for dealing with the local timezone * Workaround JS backend overflow/underflow bug * Use better workaround for not knowing the size of time_t * Use all available timezones for tests * Fix indentation * Add procs for accessing the fractional part of a duration * Order time units from smallest to largest since it makes more sense * Include months and years in `TimeUnit` * Review fix
* 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.