Commit graph

281 commits

Author SHA1 Message Date
Vladimir Panteleev
7e49cce48d std.datetime: Update Windows time zones for KB3148851 2016-04-13 21:00:47 +00:00
Jonathan M Davis
c08032edd4 Merge pull request #4068 from nrTQgc/netbsd_patch
netbsd patch
2016-03-10 22:04:53 -08:00
Nikolay Tolstokulakov
eff74ed2a2 netbsd patch 2016-03-11 10:10:47 +06:00
Steven Schveighoffer
bbc560788f Merge pull request #3983 from jmdavis/timezone
Fix compliance issues with SysTime.to*String and SysTime.from*String.
2016-03-10 12:02:00 -05:00
Sebastian Wilzbach
4f5dd92326 std.datetime - bring plaintext examples back in sync with tests 2016-03-04 12:07:27 +02:00
H. S. Teoh
5c53be7676 Merge pull request #3977 from joakim-noah/android
Android update
2016-02-23 13:51:42 -08:00
Steven Schveighoffer
b0acb7a394 Fix remaining import deprecation messages 2016-02-22 16:03:12 -05:00
Jonathan M Davis
2567a2493a Fix issue# 15654: SysTime.toISOString formats time zones incorrectly.
Previously, it formatted the time zone the same as toISOExtString and
put a colon between the hours and minutes - which is correct for the ISO
extended format, but not the non-extended format. Now, it formats it
correctly per the ISO 9601 standard.

fromISOString temporarily accepts both the extended and non-extended
formats to avoid breaking any programs that have been writing out ISO
strings to read back in later, but eventually, we'll make it so that it
only accepts the non-extended format like it's supposed to.
2016-02-20 13:10:47 -08:00
Joakim
10c01a0614 On Android, update std.datetime to extract timezone data and some other fixes. 2016-02-10 14:25:42 +05:30
Jonathan M Davis
0faa191fc8 Fix issue# 15655.
SysTime.from*String accepted single digit time zones and minutes > 59,
which is against the ISO standard. This commit fixes that.
2016-02-09 22:25:24 -08:00
Jonathan M Davis
7ded5fcf68 Rename SimpleTimeZone.to/fromISOString to to/fromISOExtString.
This is per issue# 15654.
2016-02-07 18:50:27 -08:00
Martin Nowak
6be2087858 Merge pull request #3824 from jmdavis/issue15376
Fix for issue# 15376. Get time zone conversions at runtime.
2016-01-23 15:05:59 +01:00
Jonathan M Davis
635cecee55 Fix for issue# 15376. Get time zone conversions at runtime.
It's proven to be a maintenance problem to maintain the time zone
conversions between the IANA TZ database names and the Windows time zone
names in std.datetime. So, rather than compiling them in, this provides
a way to get them at runtime (which will also make it so in the future,
older releases can work properly on up-to-date Windows boxes, which is
not the case currently with regards to time zone conversions). The
current conversion functions can be deprecated after parseTZConversions
has been out for a release (so that it's possible for users to compile
their code for two releases in a row without getting deprecation
messages).
2016-01-23 04:43:26 -08:00
Martin
756e406281 [Windows] std.datetime: Add North Korean timezone
MS recently added it with https://support.microsoft.com/en-us/kb/3093503
2016-01-21 20:57:03 +01:00
Benjamin L. Merritt
5f08c058ab Changed "Examples:" in Ddoc to "Example:" 2015-12-17 18:32:41 -08:00
Jonathan M Davis
3312e296ef Deprecate the non-benchmarking uses of TickDuration in std.datetime. 2015-12-03 00:38:34 -08:00
Lance Bachmeier
0f23dbae28 Made the new unittests consistent. 2015-11-30 16:21:52 -06:00
Lance Bachmeier
c536217a0a Changed the Examples section to a commented unittest. Made the same changes to SysTime.opBinary. 2015-11-30 16:01:48 -06:00
Lance Bachmeier
fcdf67b36e Added an example of usage of DateTime opBinary. Added a reference to core.time.Duration 2015-11-30 15:06:11 -06:00
Brian Schott
40b2e45e33 Merge pull request #3838 from jmdavis/deprecations
Move some deprecations along.
2015-11-29 11:57:28 -08:00
Vladimir Panteleev
e90be60a67 Merge pull request #3839 from aG0aep6G/ddlink
use DDLINK/DDSUBLINK instead of LINK2 and raw HTML
2015-11-27 04:54:52 +02:00
anonymous
6832caf0be use DDLINK/DDSUBLINK instead of LINK2 and raw HTML
DDLINK/DDSUBLINK use ROOT_DIR which is more robust than a relative path.
2015-11-26 16:04:44 +01:00
Jonathan M Davis
d34164a2ea Move some deprecations along. 2015-11-26 00:28:38 -08:00
Dragos Carp
75cbbef0ab Add asserts for the "compiles" tests 2015-11-16 03:04:07 +01:00
Dragos Carp
c17a621bf2 Fix timezone issue 2015-11-13 05:33:57 -04:30
Dragos Carp
eb293b5063 Fix issue 15320 2015-11-13 03:45:29 +01:00
JakobOvrum
527eeb6e06 Merge pull request #3796 from CyberShadow/pull-20151104-214649
std.datetime: Remove redundant try/catch around GetTimeZoneInformation
2015-11-06 18:44:32 +09:00
Vladimir Panteleev
e1774b6f69 std.datetime: Remove redundant try/catch around GetTimeZoneInformation
GetTimeZoneInformation is a Windows API function, and thus will never
throw a D exception. Presumably, at the time this code was written,
it was not marked as nothrow. However, instead of fixing the function's
signature, the code contained try/catch blocks with messages such as
assert(0, "The impossible happened. GetTimeZoneInformation() threw.");
2015-11-04 21:48:29 +00:00
Kai Nacke
bbd5882948 Add missing functionality for OpenSolaris to std.datetime.
Requires https://github.com/D-Programming-Language/druntime/pull/1423.
2015-11-01 12:04:54 +01:00
Walter Bright
cf22992cbb Merge pull request #3768 from CyberShadow/pull-20151024-051829
HTML fixes
2015-10-24 15:05:00 -07:00
Vladimir Panteleev
86cf380007 HTML fixes 2015-10-24 06:19:23 +00:00
Brian Schott
6ee65f477c Merge pull request #3709 from jmdavis/isTimePoint
Code reduction and clean-up for std.datetime.isTimePoint.
2015-10-16 22:40:32 -07:00
Dragos Carp
d698887729 Remove obsolete TypeTuple references
Replace following names:
std.typetuple      -> std.meta
TypeTuple          -> AliasSeq
ParameterTypeTuple -> Parameters
FieldTypeTuple     -> Fields

std.traits requires more work than search/replace and is left unchanged.
2015-10-13 20:37:44 +02:00
Jonathan M Davis
bace1f6b43 Code reduction and clean-up for std.datetime.isTimePoint.
This moves all of the private, helper templates for isTimePoint into
isTimePoint (which reduces code) and cleans up their implementation a
bit. The tests have also been improved to actually check types which are
supposed to be false with isTimePoint and the implementation adjusted
accordingly (previously, they failed to compile with isTimePoint rather
than resulting in false).

The checks for TickDuration have been removed in the process, since
we're getting rid of it. No code will break from that, since all it
means is that a type which passes isTimePoint no longer needs to work
with TickDuration. If it does work with TickDuration (as the time point
types in std.datetime will until it's been fully removed), then it will
just continue to work as it has.

This commit also improves the documentation, which was woefully vague.
2015-10-10 21:35:30 -07:00
Jonathan M Davis
e3a239e79a Fix for issue# 15085: Microsoft changed their timezone names again. 2015-09-21 01:48:35 -07:00
Robert burner Schadek
b016472042 std.datetime_doc_update 9 of 9
whitespace
2015-09-18 10:14:42 +02:00
Jonathan M Davis
7b4abd0aa7 Move deprecations along. 2015-08-29 17:01:23 -07:00
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