summary refs log tree commit diff stats
path: root/lib/pure/times.nim
Commit message (Collapse)AuthorAgeFilesLines
* Fix regression in `std/times` (#22155)Jake Leahy2023-06-261-2/+2
| | | | | | | * Add simple test case Just so the regression doesn't happen again * Specify initDateTime is gcsafe in the forward declarations
* use TimeInterval instead of Duration for calculating ISO week date (#22091)metagn2023-06-141-17/+30
| | | | | | | | | * use TimeInterval instead of Duration for calculating ISO week date hopefully actually fixes (space) #22059 * forward declare * explicit effects
* fix timezone in initDateTime for ISO week date (#22090)metagn2023-06-131-1/+1
| | | fixes #22059
* Improve times (#21901)Juan Carlos2023-05-241-12/+21
| | | | | * . * Improve times
* Weekday parse/format (replacement) (#21857)Carlo Capocasa2023-05-211-30/+110
| | | | | * parsing capability for iso week year * remove outdated test
* int64/uint64 as bigint in JS (#21613)metagn2023-04-111-1/+1
| | | | | | | | | | | * int64/uint64 as bigint in JS * fix CI * convert to compile option * fix lie * smaller diff, changelog entry
* Remove Defect from raises list in `std/times` (#21473)Jake Leahy2023-03-061-9/+15
| | | | | | | | | * Remove Defect from raises list Since defects aren't tracked anymore this causes a hint to pop up mentioning it * Still track Defect when getting ran with an older Nim version The raises followed a pattern so moving them into a pragma didn't seem to cause any extra problems
* Make `Time` work with `std/strformat` (#21409)Jake Leahy2023-02-211-5/+1
| | | | | | | * Add test case * Remove formatValue template for `Time` It didn't handle empty specifier correctly which caused it to be blank with strformat
* fix #21045; getTime with vmopsDanger is broken; alternative to #21054 (#21056)ringabout2022-12-101-19/+25
| | | | | * fix #21045 getTime with vmopsDanger is broken; alternative to #21054 * typo
* fix #16264 low(Time) OverflowDefect (#20552)Bung2022-10-291-1/+1
| | | fix #16264 regression(0.18.0 => devel): import times; echo low(Time) gives OverflowDefect
* fix broken runnableExamples for getWeeksInIsoYear (#20193)metagn2022-08-111-2/+2
| | | | | Based on what I understand from [Wikipedia](https://en.wikipedia.org/wiki/ISO_week_date#Weeks_per_year), 2001 does not have 53 weeks, but 2004, 2009, 2015, 2020 do. The years 2000 and 2001 seem to be copy pasted from the `getDaysInYear` example above. The result of `getWeeksInIsoYear` also seem to match up with Wikipedia. That means these runnableExamples were never tested. Why is this the case? I only discovered this in #20091.
* move assertions out of system (#19599)flywind2022-03-231-0/+4
|
* Add Week-Of-Year Implementation to Times Module (#17223)Carlo Capocasa2022-01-031-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * initial * more tests * Apply suggestions from code review idiomatize Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * test iron age dates * add examples * fix typo * consistent param mention * add since pragrams * add changelog * Update lib/pure/times.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * fix examples * fix negative years * add getWeeksInYear tests * add back fix dropped by rebase * week-year tuple api * add changelog * fix doc tags * add docstrings * fix typos Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* remove deprecated stuffs from std/times (#18937)flywind2021-10-131-25/+25
|
* strict effects (#18777)Andreas Rumpf2021-09-021-1/+1
| | | | | | | | | | | | | | | | | * fixes #17369 * megatest is green for --cpu:arm64 * docgen output includes more tags/raises * implemented 'effectsOf' * algorithm.nim: uses new effectsOf annotation * closes #18376 * closes #17475 * closes #13905 * allow effectsOf: [a, b] * added a test case * parameters that are not ours cannot be declared as .effectsOf * documentation * manual: added the 'sort' example * bootstrap with the new better options
* fix #17072: add times.dateTime with ISO 8601 order (#18590)Timothee Cour2021-07-281-11/+18
| | | | | * fix #17072: add times.dateTime with ISO 8601 order * address comments
* Missing spaces when compiling testament and nim_dbg. (#18403)Endeg2021-06-301-2/+2
|
* couple tiny typo fixes (#18344)Smooth Operator2021-06-241-2/+2
|
* [std/times]getTime now uses high resolution API on windows (#17901)flywind2021-06-231-2/+3
|
* [docs minor] close #17618 (#17620)flywind2021-04-021-9/+12
| | | | | | | | | * [docs minor] close #17618 * Update lib/pure/times.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* doc times: do not use `now` (and also `epochTime`) for benchmarking (#17405)Timothee Cour2021-03-181-1/+6
| | | | | | | | | | | | | * doc times: do not use now for benchmarking * Update lib/pure/times.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update lib/pure/times.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* refs #4347, add `ZZZ` and `ZZZZ` patterns for timezone offsets without ↵Miran2021-03-111-17/+29
| | | | colons (#17318)
* Replace double backticks with single backticks - Part 5 out of ~8 (#17217)Danil Yarantsev2021-03-011-232/+232
| | | Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Change stdlib imports to use std prefix in most examples (#17202)Danil Yarantsev2021-02-281-1/+1
|
* Correct all eggs (#15906)Miran2020-11-101-1/+1
| | | | * "eg" is a misspelled "egg", "e.g." is "exempli gratia" * Also, "ie" is "i.e.".
* fix mistake in times.nim docsnarimiran2020-07-071-1/+1
|
* Revert commit 3e843ab3358. Closes #14930.Dominik Picheta2020-07-071-1/+1
|
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-8/+10
| | | | | | | | | | | * I don't care about observable stores * enforce explicit initializations * cleaner code for the stdlib * stdlib: use explicit initializations * make tests green * algorithm.nim: set result explicitly * remove out parameters and bring the PR into a mergable state * updated the changelog
* Remove deprecated stuff from stdlib (#14699)Miran2020-06-171-171/+4
| | | | | | | * update to the latest Jester * remove deprecated procs from some stdlib modules * 'criterion' is not maintained anymore and relies on obsolete stuff
* Added --benchmarkVM to times.cpuTime() documentation (#14663)Ico Doornekamp2020-06-151-0/+2
|
* Make the fields of `times.DateTime` private (#14197)Oscar Nihlgård2020-05-061-76/+180
| | | | | * Make the fields of `times.DateTime` private * PR fixes
* move since from inclrtl to std/private/since (#14188)hlaaftana2020-05-021-1/+2
| | | | * move since from inclrtl to std/private/since * move since import in system below for HCR
* Remove some deprecated procs from std/times (#14129)Oscar Nihlgård2020-04-271-143/+31
|
* Times refactorings (#13949)Oscar Nihlgård2020-04-211-753/+778
|
* fix https://github.com/nim-lang/RFCs/issues/211: `var a: DateTime` compiles ↵Timothee Cour2020-04-181-3/+10
| | | | | | | and is usable (#14002) [backport:1.2] * fix https://github.com/nim-lang/RFCs/issues/211: `var a: DateTime` works * assertValidDate checks for sentinel month
* refs #13797 (#13812)Timothee Cour2020-03-311-1/+1
|
* fixes #13558: toDateTime buggy on 29th, 30th and 31th of each month; ↵Timothee Cour2020-03-111-13/+3
| | | | breaking change: do not use `now` to compute result, was undocumented and non-sensical (#13565)
* fixes #13543 and added times.isLeapDay (#13547)Timothee Cour2020-03-011-0/+13
|
* Add sideEffect pragma to importC procs in posix, winlean and time module ↵Tomohiro2020-02-081-3/+3
| | | | | | | | | (#13370) * Add sideEffect pragma to procs in winlean * Add sideEffect pragma to procs in posix * Add test for #13306 * Add sideEffect pragma to procs in times * Fixes #13306
* [backport] times/getClockStr(): fix mistake in doc (#13229) [ci skip]Milan2020-01-221-1/+1
|
* fixes a critical times.nim bug reported on IRC [backport] (#13216)Andreas Rumpf2020-01-211-2/+3
|
* times: toUnixFloat, fromUnixFloat (#13044)Timothee Cour2020-01-181-9/+28
|
* style fix: change 'JS' to 'js' to make it consistent (#13168)Miran2020-01-161-7/+7
|
* [minor] fix doc for $(Time) (#12795) [backport]Timothee Cour2019-12-031-1/+1
|
* fix documentation of `$`*(dt: DateTime) (#12660)David Krause2019-11-151-1/+1
| | | | (cherry picked from commit 39122ecd93854dd696aad2a5a0a5ad04d6dcdbfa)
* [backport] run nimpretty on the remaining filesnarimiran2019-09-301-74/+88
|
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-4/+4
|
* makes tests green againAndreas Rumpf2019-09-211-9/+9
|
* Add std/monotimes which implements monotonic timestamps (#11712)Andreas Rumpf2019-07-151-9/+16
|\ | | | | | | | | | | * [feature] Added std/monotimes * [other] Minor optimization in times
| * [other] Minor optimization in timesOscar Nihlgård2019-07-121-9/+12
| |