Commit graph

244 commits

Author SHA1 Message Date
Martin Nowak
5ca7ddad60 Merge remote-tracking branch 'upstream/stable' into merge_stable
Conflicts:
	posix.mak

Manually edited:
	std/datetime.d (rename toNormalizedPath -> asNormalizedPath)
2015-07-24 01:28:58 +02:00
Jonathan M Davis
4899aa85d2 Implement issue# 14792: Add SysTime.fromUnixTime.
We've had the ability to convert from unix time to SysTime, but it has
been more unwieldy than it should be. This adds fromUnixTime to go with
toUnixTime.

In addition, these changes solve the problem where you sometimes need a
value for unix time that doesn't fit in time_t (e.g. a 64-bit value on a
32-bit system), or you're dealing with a 64-bit time_t on a 32-bit
system (which Windows sometimes does). So, toUnixTime and
stdTimeToUnixTime now take an optional template argument which indicates
how many bits the result should be (defaulting to match the size of
time_t), and fromUnixTime and unixTimeToStdTime now take long rather
than time_t so that they can accept 64-bit values on 32-bit systems.
2015-07-13 16:21:36 -07:00
Dmitry Olshansky
14330724fd Merge pull request #2584 from jmdavis/13433
Implement issue 13433 - add option for using coarser realtime clock.
2015-06-29 21:40:57 +03:00
Dmitry Olshansky
bcedffd0ee Merge pull request #2943 from MartinNowak/useInitOnce
use initOnce for lazy shared initialization
2015-06-26 20:51:14 +03:00
Walter Bright
d6940dace1 std.datetime - start using ranges 2015-06-19 13:55:13 -07:00
jmdavis
5f3c6f1a64 Implement issue 13433: coarser realtime clock
This adds an option for getting the time using an alternative clock
chosen via core.time.ClockType, including access to a coarser clock as
requested by issue# 13433.

For ClockType.normal, the normal clock which has always been used is
used.

For ClockType.coarse, a faster clock is used if available even if it's
coarser so long as it still has sub-second precision, and the normal
clock is used if no such clock is available.

For ClockType.precise, a more precise clock is used if available
(currently only on FreeBSD), otherwise the normal clock is used.

For ClockType.second, a faster clock is used which only has second
precision. If no such clock is available, then the normal clock is used,
but the result is truncated to second precision.
2015-06-08 12:32:12 -07:00
Daniel Murphy
ebc90dc149 Merge pull request #2657 from joakim-noah/separate_glibc
Separate linux kernel, glibc, and bionic APIs where appropriate
2015-05-30 08:22:30 -06:00
Robert burner Schadek
8ea3f08a8d datetime: update alias syntax 2015-05-28 18:38:34 +02:00
Joakim
3352c90c2e Separate linux kernel, glibc, and bionic APIs where appropriate 2015-05-27 21:54:52 -05:00
Walter Bright
d9a9826e55 Revert "Introducing std.meta package" 2015-05-06 14:36:45 -07:00
Dicebot
82f54a38d3 TypeTuple -> MetaList inside Phobos 2015-05-05 22:22:11 +03:00
Dicebot
73f773838d import std.typetuple -> import std.meta 2015-05-05 22:22:10 +03:00
Jonathan M Davis
f4067cf33d Add workaround in std.datetime unit tests for bug in FreeBSD 9+.
The std.datetime unit tests currently fail on FreeBSD 9+ because of a
bug in FreeBSD itself (which it looks like Martin reported):

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=168862

tzname[] is set incorrectly in many time zones - including
America/Los_Angeles, which is what's causing the unit test failures in
std.datetime.

Sadly, the bug report has been around for almost 3 years without the bug
getting fixed (with the report including a patch no less), so I don't
know how long it will take them, and it just seems better to version out
the test in FreeBSD for now, since it's potentially a blocker for anyone
developing Phobos on FreeBSD.

The autotester doesn't exhibit the problem, because it's using FreeBSD
8.x.
2015-04-26 18:02:59 -07:00
Martin Nowak
10cbf750f5 use initOnce for lazy shared initialization
- use TickDuration.currSystemTick instead of Clock.currSystemTick
  to break cyclic dependency of std.datetime and std.concurrency
2015-02-11 20:31:37 +01:00
Walter Bright
dc302d26a4 DIP25: make phobos work with it 2015-01-30 12:02:48 -08:00
Daniel Murphy
6af3fb5525 Remove implicit conversions from array to bool 2015-01-27 21:55:00 +11:00
k-hara
a40422b2aa Add missing imports 2015-01-07 00:18:56 +09:00
H. S. Teoh
d971256ecd Don't import std.format in any public scope.
Workaround for: https://issues.dlang.org/show_bug.cgi?id=13808
2014-12-02 07:55:44 -08:00
Rainer Schuetze
7c2f962b10 make nested foreach over TypeTuple bodies into lambdas to avoid huge functions 2014-11-28 17:15:37 +01:00
David Nadlinger
ed7575f7b0 Merge pull request #2704 from MartinNowak/nothrowScheduler
nothrow for Schedulder
2014-11-27 20:47:51 +01:00
Ilya Yaroshenko
2c744b54e1 std.range: constraints => primitives
See discussion and voting in #2661
2014-11-23 20:05:20 +03:00
Martin Nowak
354544b6bb nothrow for Schedulder
- require nothrow for thisInfo, yield

- make Condition methods nothrow
2014-11-23 00:41:57 +01:00
H. S. Teoh
daaa7c70fe Merge pull request #2755 from 9il/imports
clean scope imports
2014-11-21 10:38:53 -08:00
David Nadlinger
7e80e67630 Merge pull request #2728 from 9il/typecons
std.typecons: remake toString to template, clean module imports
2014-11-20 22:11:54 +01:00
Ilya Yaroshenko
c8d9afedea clean scope imports
imports of `std.range, std.algorithm, std.array, std.string,
std.format, std.uni` are affected.
2014-11-21 00:08:35 +03:00
Ilya Yaroshenko
af02101ab9 std.typecons: remake toString to template, clean module imports
update datetime unittests
2014-11-20 23:08:33 +03:00
Lars T. Kyllingstad
96583fe46b isNaN() is not a property
...so it shouldn't be used as one.
2014-11-20 20:22:00 +01:00
Jonathan M Davis
57f316172f Merge pull request #2681 from 9il/datetime
std.datetime: clean imports
2014-11-16 16:10:14 -08:00
Ilya Yaroshenko
0b5b55cf19 remove .dup 2014-11-14 00:14:57 +03:00
Ilya Yaroshenko
4ef70b68e3 fix scope import for Windows 2014-11-13 02:40:28 +03:00
Ilya Yaroshenko
61e48ebb8a fix import 2014-11-12 17:15:46 +03:00
Ilya Yaroshenko
29febefa87 add local import 2014-11-12 15:53:00 +03:00
Walter Bright
1f7142f941 use auto return in std.datetime 2014-11-12 01:54:39 -08:00
Ilya Yaroshenko
2cf7b4795f datetime scope imports
more scope imports

restore std.time global import

check scope imports

update windows unitises
2014-11-11 18:14:12 +03:00
Joakim
800506b794 Deprecate last remaining module from std.c and move it to druntime 2014-10-31 12:04:41 -05:00
Geod24
0fb95b8c27 Usage of WEB macro for License everywhere 2014-10-15 11:30:42 +02:00
jmdavis
26d7c69bc9 Update to time zone conversions due to MS updates. 2014-10-09 09:08:09 -07:00
Igor Stepanov
8b32555eab fix datetime test 2014-10-06 21:36:41 +00:00
Martin Nowak
fb405239ae fix doc 2014-10-04 09:46:32 +02:00
Denis Shelomovskij
d63035003a Fix some property enforcements. 2014-09-01 18:01:16 +04:00
Geod24
7100047473 Replace enforceEx with enforce where it's possible 2014-08-25 12:18:02 +02:00
Denis Shelomovskij
ff144b0ae0 Replace most toStringz/toUTF16z/toUTFz usages with tempCString* ones.
Only non-trivial cases left when a refactoring is required to use a temporary buffer.
Also add `nothrow`/`@nogc` attributes.
2014-08-23 17:23:13 +04:00
jmdavis
66e81b6824 Change SysTime.fracSec to "scheduled for deprecation" from deprecated.
Vladamir has a use case where the deprecation gives him a wall of
deprecation messages, and because he needs to use both 2.066 and master,
he can't move his code over to fracSecs yet. So, I'm changing the
deprecation to "scheduled for deprecation" for one release. And because
of this case, I think that I'm going to change the general policy to
"scheduling for deprecation" for one release before actually deprecating
a symbol. The fact that deprecated just generates a message mostly
obviates the need for "scheduling for deprecation" like we used to do,
but with this change, it will give folks one release to avoid the wall
of deprecation messages if they happen to use the deprecated symbol a
lot (or just once in a frequently instantiated template as in Vladamir's
case). It probably won't do anything for anyone who doesn't read the
changelog, but it will help out the folks who do.
2014-08-20 20:48:10 -07:00
k-hara
0367623a2c fix up issue 13313 - Support database name to Windows timezone name conversion 2014-08-20 00:18:47 +09:00
jmdavis
56f986a8d4 Fix compilation errors on Windows. 2014-08-18 16:20:59 -07:00
jmdavis
f10ed1a90e Fix issue# 13313: Line Islands Standard Time was missing.
It's included in this update http://support.microsoft.com/kb/2981580 but
has yet to make it into
http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html
2014-08-18 01:43:48 -07:00
jmdavis
503699a781 Update the Windows TZ name conversions.
I also added a script at the bottom of std.datetime which can be used to
regenerate the conversions from the latest conversion file at
unicode.org so that it will be much easier to make such updates in the
future.
2014-08-18 01:41:48 -07:00
jmdavis
3a5a11038d Issue# 13319. Make tzDatabaseNameToWindowsTZName return null on failure. 2014-08-18 01:36:23 -07:00
H. S. Teoh
1c867ac48a Fix mismatching param name. 2014-08-14 18:24:34 -07:00
jmdavis
d0a1a7bcf8 Cleanup of a version-else block in std.datetime so that it has an else. 2014-07-30 01:02:33 -07:00