Commit graph

193 commits

Author SHA1 Message Date
MoonlightSentinel
64f7b67eff Disable undocumented_declaration_check for std.datetime
Multiple public declarations (measureTime, ...) are deprecated and were undocumented.
Re-enable this check once these deprecated symbols are removed.
2019-12-02 20:56:47 +01:00
MoonlightSentinel
01412607f9 Advance deprecation in std.datetime 2019-12-02 19:39:26 +01:00
Berni
36ac5614ef Fix issue 20145 - Random unittest failures in std.datetime.stopwatch 2019-09-17 16:23:51 +02:00
Nicholas Wilson
b1413e3cde
function attributes go on the right of function aliases
FuncType is actually `@system` because of this, for some reason it is still `pure` and `nothrow`.
2019-06-11 09:51:32 +08:00
The Dlang Bot
7972cca21f
Merge pull request #7025 from wilzbach/import-selective2
Use selective top-level module imports in std.{base64,csv,datetime}
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2019-05-23 15:59:38 +02:00
Sebastian Wilzbach
9092826b27 Use selective top-level module imports in std.{base64,csv,datetime} 2019-05-23 09:57:13 +02:00
Steven Schveighoffer
96f98ff380 Change version(unittest) code to use accessors to wrap the static
initializers. This prevents the compiler from executing the initializers
using CTFE during importing, when using unittest.
2019-05-22 14:55:06 -07:00
Rainer Schuetze
2e13c10025 add workaround for https://issues.dlang.org/show_bug.cgi?id=2396 to reduce compile time of unittests 2019-03-29 12:12:53 +01:00
tibi77
7ae2e67a47 Remove redundant body of @disable functions. Issue 14854 DMD (#6893)
Remove redundant body of @disable functions. Issue 14854 DMD
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2019-03-06 02:00:04 +01:00
Nathan Sashihara
d1df4f37d8 Fix NetBSD curStdTime error introduced by PR 6785 2018-12-18 18:29:14 -05:00
The Dlang Bot
5e6fe2f9c8
Merge pull request #6809 from n8sh/reduce-windows.d
Replace imports of core.sys.windows.windows to speed up compilation
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
2018-12-19 00:22:11 +01:00
Nathan Sashihara
6ffd4e7f28 Replace imports of core.sys.windows.windows to speed up compilation 2018-12-17 21:03:31 -05:00
Nathan Sashihara
0f20fa219c Fix Issue 19453 - Remove unnecessary error checks in std.datetime.systime.currStdTime()
Posix gettimeofday called with a valid timeval address and a null second
parameter doesn't fail. Posix clock_gettime called with a valid clock_id
is only permitted to fail if the number of seconds does not fit in time_t.
2018-11-30 06:12:18 -05:00
Vladimir Panteleev
d18d52641c
std.datetime.date: Clarify that add/roll mutate the current object
It was not clear from the documentation whether these methods mutate
the current object, or return a new object with the applied
modification. The fact that these functions have a non-void return
type adds to the confusion.

Clarify this by explicitly mentioning that the functions mutate the
current object, and add a "Returns:" DDoc section documenting that the
methods simply return `this`.
2018-11-01 21:24:52 +00:00
Iain Buclaw
fd5facfe04 posix.mak: Enforce whitespace before opening parenthesis for version conditions 2018-09-22 16:57:24 +02:00
Basile Burg
db819575f1 Fix issue 11959 - Set private symbols declared in version(unittest) blocks 2018-08-26 10:22:11 +02:00
Jonathan M Davis
371ed2c475 Clean up use of scope in std.datetime.systime.
This removes unnecessary uses of scope, adds a lot of necessary uses of
scope, and adds basic tests that ensure that each of the functions in
std.datetime.systime compile when given scope arguments. It also enables
some previously commented out tests involving immutable SysTimes (IIRC,
they didn't use to compile due to compiler bugs related to
Rebindable!(immutable TimeZone), but they now compiler, so they should
be enabled).
2018-06-27 21:27:43 -06:00
The Dlang Bot
ec8bb20d28
Merge pull request #6591 from jmdavis/issue_17732_again
Fix issue 12507: SysTime.init.toString() segfaults.
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
2018-06-26 13:33:50 +02:00
Jonathan M Davis
9b1f72d89b Fix issue 12507: SysTime.init.toString() segfaults.
This adds a special TimeZone type internal to SysTime which _timezone is
directly initialized to so that SysTime.init will work without
segfaulting but will still be uniquely identifiable with the is
operator. Or at least, _timezone is _supposed_ to be directly
initialized to it, but issue# 17740 currently prevents that. So,
_timezone has been temporarily renamed to _timezoneStorage and private
getters and setters named _timezone have been added. The getter then
does a null check and returns InitTimeZone() for SysTime.init to
simulate the member variable having been initialized to InitTimeZone().
Once issue# 17740 has been fixed, these accessors will be unnecessary,
and the code should be updated so that _timezone is properly a variable
again and is directly initialized with InitTimeZone().

The new TimeZone type - InitTimeZone - is internal to SysTime and can
only be obtained by the timezone getter on SysTime.init. It acts the
same as UTC except that it is not special-cased by the to*String
functions and thus will print out its timezone as +00:00 instead of z,
which is perfectly legitimate per the spec. And as such, if _timezone
were directly initialized with InitTimeZone(), there would be no extra
checks due to this change, and everything would just work. However,
until issue# 17740 is fixed, there will be an extra null check any time
that a function is called on _timezone, because _timezone is currently a
wrapper that does a null check rather than being a member variable
directly like it's supposed to be.

Unlike previous attempts along these lines, this does not make it so
that SysTime.init has NaN behavior such that any operation (other than
assignment) on an an uninitialized SysTime would result in SysTime.init,
and the timezone setter property does not set the SysTime to
SysTime.init if it's passed this TimeZone. So, unfortunately, it _is_
possible to have other SysTime values with the special TimeZone, but it
was deemed unnecessarily complex for too little benefit to add the NaN
behavior. And regardless, SysTime.init is still uniquely identifiable
via the is operator. It's just that it can't technically be uniquely
identified by the timezone getter, which was never a supported feature
anyway.
2018-06-26 02:22:49 -06:00
The Dlang Bot
9334f46371
Merge pull request #6610 from jmdavis/scope_const_date
Remove const scope from value types in std.datetime.date.
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2018-06-26 01:19:15 +02:00
Jonathan M Davis
9e09703b8c Remove const scope from value types in std.datetime.date.
None of these uses of const scope should be required, because Date,
TimeOfDay, and DateTime are all value types with no indirections.
2018-06-24 19:38:12 -06:00
Jonathan M Davis
e3de72cfea Remove deprecated functions from std.datetime.timezone. 2018-06-24 18:03:51 -06:00
The Dlang Bot
d682187cfe
Merge pull request #6598 from Alexibu/patch-1
Document deprecation of TimeZone.getTimeZone
merged-on-behalf-of: Jonathan M Davis <jmdavis@users.noreply.github.com>
2018-06-24 12:15:26 +02:00
The Dlang Bot
67a86ee574
Merge pull request #6602 from WalterBright/date-in
dip1000: std.datetime.date replace 'in' with 'scope const'
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
2018-06-24 11:19:51 +02:00
The Dlang Bot
82a7dc6f08
Merge pull request #6604 from WalterBright/interval-in
interval std.datetime.interval replace 'in' with 'scope const'
merged-on-behalf-of: Walter Bright <WalterBright@users.noreply.github.com>
2018-06-24 09:42:12 +02:00
The Dlang Bot
6180697df3
Merge pull request #6603 from WalterBright/timezone-in
dip1000: std.datetime.timezone replace 'in' with 'scope const'
merged-on-behalf-of: Walter Bright <WalterBright@users.noreply.github.com>
2018-06-24 08:31:04 +02:00
Walter Bright
878277200d interval std.datetime.interval replace 'in' with 'scope const' 2018-06-23 23:26:57 -07:00
Walter Bright
92aa49952b dip1000: std.datetime.timezone replace 'in' with 'scope const' 2018-06-23 22:32:50 -07:00
Walter Bright
4f47997635 dip1000: std.datetime.date replace 'in' with 'scope const' 2018-06-23 22:21:17 -07:00
Walter Bright
f6aeb514c0 dip1000: std.datetime.system replace 'in' 2018-06-23 21:18:05 -07:00
Jonathan M Davis
852dc7ef6e
Some fixes to the docs for TimeZone and LocalTime
The information that the docs for TimeZone and LocalTime gave about the TZ Database
was outdated.
2018-06-22 19:28:31 -06:00
Alexibu
58f8200fc7
Update timezone.d 2018-06-22 20:39:45 +10:00
Alexibu
8d971df834
Document deprecation of TimeZone.getTimeZone
There was documentation refering to the now deprecated method of getting one of the of the timezone implementations via the static TimeZone.getTimeZone.
2018-06-22 20:30:50 +10:00
Nathan Sashihara
27257d1413
Revert "Add dontOptimizeAway to std.datetime.stopwatch" 2018-06-13 16:19:17 -04:00
The Dlang Bot
e257ce133a
Merge pull request #5416 from wilzbach/dontoptimizeaway
Add dontOptimizeAway to std.datetime.stopwatch
merged-on-behalf-of: unknown
2018-06-13 20:07:09 +02:00
Joakim
f916d73af7 Musl: last remaining tweaks 2018-06-07 11:58:44 +05:30
The Dlang Bot
a56ae8026b
Merge pull request #6542 from wilzbach/underscore
Remove a few cases of underscore escaping
merged-on-behalf-of: Steven Schveighoffer <schveiguy@users.noreply.github.com>
2018-06-04 22:29:52 +02:00
Roman Chistokhodov
12185caf84 Add nogc attribute to unixTimeToStdTime 2018-06-04 16:13:27 +03:00
Sebastian Wilzbach
c324714fde Remove a few cases of underscore escaping 2018-06-04 13:05:01 +02:00
The Dlang Bot
ca72c991cd
Merge pull request #6422 from wilzbach/duplicate-static-gshared
Remove redundant 'static' storage classes on __gshared variables
merged-on-behalf-of: Jack Stouffer <jack@jackstouffer.com>
2018-04-05 20:30:54 +02:00
Sebastian Wilzbach
6f766dce5d Remove redundant 'static' storage classes 2018-04-05 13:11:48 +02:00
Sebastian Wilzbach
6f1bb469ef Fix Issue 18704 - std/datetime/stopwatch.d(452) assertion failure on auto-tester 2018-04-05 07:14:20 +02:00
The Dlang Bot
0d45880abe
Merge pull request #6356 from JackStouffer/datetime-docs
Simplified std.datetime.package overview
merged-on-behalf-of: Jack Stouffer <jack@jackstouffer.com>
2018-04-05 05:07:11 +02:00
Jack Stouffer
bc6e75e5a9 Added examples to std.datetime.systime 2018-04-04 10:42:37 -04:00
Jack Stouffer
a737f62160 Simplified std.datetime.package overview 2018-04-04 09:23:52 -04:00
Sebastian Wilzbach
6797808b39
Merge pull request #6366 from FeepingCreature/fix/localtime-has-always-been-broken-and-should-never-have-been-used
Fix localtime
2018-04-03 11:21:56 +02:00
Mathis Beer
5d6bf2bdd2 Do not call localtime. It is not threadsafe. You will randomly return wrong times in threaded apps. Fixes Issue 18714. 2018-04-03 09:57:00 +02:00
Sebastian Wilzbach
42894784dd Markdownify Phobos
$(D word) -> `word`
2018-04-02 22:32:47 +02:00
Sebastian Wilzbach
81b05c0fdd std.datetime: make -dip1000 compatible 2018-03-28 02:33:10 +02:00
Jack Stouffer
5094a273a8 Fixed >120 character line in std.datetime.timezone 2018-03-26 15:25:35 -04:00