1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Commit Graph

44 Commits

Author SHA1 Message Date
Delyan Angelov
0cc0e87051 time: use linux_utc() and linux_now() on freebsd too (more precise, and fixes time_test.v) 2022-09-01 09:54:20 +00:00
David 'Epper' Marshall
c28051020a
time: fix calculate_date_from_offset (#14399) 2022-05-15 10:55:24 +03:00
Cameron Katri
d585fbea8a
time: implement Time.strftime(fmt string) as a wrapper for strftime(3) (#13898) 2022-04-02 18:33:37 +03:00
Vincenzo Palazzo
02c80bd445
time: fix repetitive time.now().local().local().local() offsetting the time further and further (#13861) 2022-04-01 00:11:17 +03:00
Delyan Angelov
49ebba535e
time: implement pub fn since(t Time) Duration 2021-10-24 21:36:28 +03:00
yuyi
108a01d65f
fmt: fix unnecessary line break in array init (fix #11448) (#11562) 2021-09-21 16:20:09 +03:00
Delyan Angelov
efa8dcf4d2
time: turn Time.unix to i64, so it can represent times before 1970-01-01, fix time operators, add more tests (#11050) 2021-08-04 13:12:02 +03:00
Ekopalypse
1b7fd2cf00
time: fix time offset (#9449) 2021-03-27 17:34:34 +02:00
Alexander Medvednikov
3a2d696fac time: time.wait() => time.sleep() 2021-02-27 20:41:06 +03:00
zakuro
ac4791045f
time: consolidate the different sleep functions into time.wait(Duration) (#8853) 2021-02-21 17:05:03 +02:00
Lukas Neubert
75d85403a6
fmt: better ternary concat wrapping (#8379) 2021-01-28 11:23:48 +01:00
Delyan Angelov
dbaccd4272
vfmt: shorten main.const_name to just const_name 2021-01-25 20:57:33 +02:00
Delyan Angelov
728344ff65
ci: fix v test-cleancode 2021-01-25 12:55:01 +02:00
Lukas Neubert
8b61891348
fmt: smarter if condition wrapping (#8201) 2021-01-23 10:33:22 +02:00
zakuro
c639dd03d0
time: move - operator to operator.v (#7433) 2020-12-21 09:28:00 +01:00
zakuro
6a74058190
time: make parse_iso8601 support a date only format (#7277) 2020-12-16 13:10:02 +02:00
Takahiro Yaota
eb48208599
time: Time.add (#7262) 2020-12-12 04:22:30 +01:00
Takahiro Yaota
a2f7e0636d
time: - operator overloading (#7259) 2020-12-11 06:54:23 +01:00
Delyan Angelov
0c192cfd64 tests: fix warnings when doing ./v -W -progress -check-syntax test-fixed 2020-10-26 14:41:57 +02:00
penguindark
7d52d612ce
rand: add rand.ulid() (#5979)
* removed debug println

* added newline to the end of the file

* time: add .unix_time_milli() method; rand,time: add tests

* rand: add more ulid tests; move tests to a separate file random_identifiers_test.v

* run vfmt over vlib/rand/random_identifiers_test.v

* speed up time.unix_time_milli

* simplify and speedup time.unix_time/0 and time.new_time/1

* update comment about rand.ulid()

* fix terminating 0 off by 1 issue in rand.ulid()

* optimize time.new_time()

* restore the master version of vlib/time/parse.v

* make test_unix_time more robust

Co-authored-by: Delyan Angelov <delian66@gmail.com>
2020-07-26 13:10:56 +03:00
Delyan Angelov
8f23accc4e time: add .format_ss_milli and .format_ss_micro methods 2020-07-21 11:58:33 +03:00
Tomas Hellström
2dc547a45c
time: fix iso8601 parser and utc time 2020-06-10 11:14:55 +02:00
Tomas Hellström
9c8769503f
time: add microsecond precision to Time struct 2020-06-07 16:19:09 +03:00
Uwe Krüger
fd4d28b7b6
tests: update for stricter type checks 2020-05-24 21:07:32 +02:00
spaceface777
ef8c1203b4
cleanup: replace C for loops with range 2020-02-24 17:55:16 +01:00
Alexey
65744207fc
time: reorganize module 2020-02-06 14:19:44 +01:00
Alexey
91e181b14a
time: return optional value in parse and parse_iso functions 2020-02-06 10:22:00 +01:00
Alexey
a61c9c617d
time: use _mkgmtime and timegm to calculate unix time 2020-02-05 06:13:11 +01:00
vitalyster
21b54723e4
time: fix timezone 2020-02-04 12:17:04 +01:00
nsauk
84438c0139 time: add str() 2020-01-20 15:06:15 +01:00
Alexander Medvednikov
87cff0386c time: gmt offset; macos syscalls 2020-01-01 10:09:19 +01:00
sh0f
3c17851200 time: add test for #3291 2020-01-01 08:00:23 +01:00
Alexander Medvednikov
4d31d5882d x64, v2 backends 2019-12-31 19:42:16 +01:00
lutherwenxu
286a0a1371 time: rewrite unix() function 2019-12-31 17:11:47 +01:00
Alexander Medvednikov
da5fb5dcbd Revert "x64, v2 backends"
This reverts commit 81ae54d9bd.
2019-12-31 13:23:12 +01:00
Alexander Medvednikov
81ae54d9bd x64, v2 backends 2019-12-31 13:21:22 +01:00
yatsen1
137a473bb7 add time.parse_iso 2019-12-23 13:36:51 +03:00
yatsen1
d03f0ec294 fix time.parse() 2019-12-23 13:25:44 +03:00
Alexey
dacc129fd8 time: improve tests 2019-12-22 22:58:41 +03:00
Enrico Lefass
a691cc857e time: add new public functions for formatting 2019-11-01 02:13:03 +03:00
Alexander Medvednikov
207bab5f79 generics, vweb, comptime codegen, etc 2019-07-29 18:24:48 +02:00
Alexander Medvednikov
6995cc0234 time: fix test_days_in_month() 2019-07-14 16:47:02 +02:00
nxshock
1ce295b683 time: days_in_month() 2019-07-14 16:43:57 +02:00
nxshock
b3e5c89ba9 time: add is_leap_year(year int) 2019-07-03 18:55:07 +02:00