darcs-mirrors/time.git
4 years agotzset regardless of HAVE_LOCALTIME_R master
Ashley Yakeley [Sat, 19 Jul 2014 20:37:05 +0000 (20:37 +0000)] 
tzset regardless of HAVE_LOCALTIME_R

5 years agoversion 1.4.2; improve Makefile 1_4_2
Ashley Yakeley [Mon, 3 Mar 2014 05:18:43 +0000 (05:18 +0000)] 
version 1.4.2; improve Makefile

5 years agoChanges for Safe Haskell
omari [Thu, 13 Feb 2014 23:24:36 +0000 (23:24 +0000)] 
Changes for Safe Haskell

Makes minimal necessary changes so that modules will infer as Safe
for Safe Haskell.  Some modules are using rewrite rules, which are
not Safe; to these I added Trustworthy pragmas.  The rewrite rules
will continue to fire as normal, according to GHC's documentation.

Other modules import Foreign.  I changed these to import
Foreign.Safe instead.

I changed the time.cabal file so that the minimum version of Base is
4.4; that was the first version of Base that has the Foreign.Safe
module.  (base 4.4 came with GHC 7.2, which is over two years old.)

6 years agouse throwErrnoIfMinus1 gettimeofday for consistency in error handling 1_4_1
Dylan Simon [Sat, 26 Jan 2013 02:59:54 +0000 (02:59 +0000)] 
use throwErrnoIfMinus1 gettimeofday for consistency in error handling

6 years agoDerive Typeable instances
jpm [Wed, 28 Nov 2012 14:58:44 +0000 (14:58 +0000)] 
Derive Typeable instances

6 years agodetabify cbits
Ashley Yakeley [Mon, 24 Jun 2013 00:35:10 +0000 (00:35 +0000)] 
detabify cbits

6 years agoRegression test for getTimeZone.
oconnorr [Fri, 14 Jun 2013 19:19:45 +0000 (19:19 +0000)] 
Regression test for getTimeZone.

The localtime_r call made from getTimeZone may or may not perform a tzset().
In particular, in glibc, a tzset() will only be performed the first time a process runs localtime_r.

This added regression test will fail on implementations like glibc that only
perform a tzset() on the first call to localtime_r.

A fix to make getTimeZone always call tzset() can be found in patch:

[Make getTimeZone cross-platform consistent by always considering the TZ environment variable.
oconnorr@google.com**20130610222254

6 years agoMake getTimeZone cross-platform consistent by always considering the TZ environment...
oconnorr [Mon, 10 Jun 2013 22:22:54 +0000 (22:22 +0000)] 
Make getTimeZone cross-platform consistent by always considering the TZ environment variable.

The current behaviour of getTimeZone is system dependent.  On Linux, using glibc we get the following result:

$ ghc -package time-1.4 -e 'System.Posix.Env.putEnv "TZ=EST5EDT" >> Data.Time.getCurrentTimeZone >>= print >> System.Posix.Env.putEnv "TZ=PST8PDT" >> Data.Time.getCurrentTimeZone >>= print'
EDT
EDT

Under MacOS X we get a different result

$ ghc -package time-1.4 -e 'System.Posix.Env.putEnv "TZ=EST5EDT" >> Data.Time.getCurrentTimeZone >>= print >> System.Posix.Env.putEnv "TZ=PST8PDT" >> Data.Time.getCurrentTimeZone >>= print'
EDT
PDT

The underlying problem is that POSIX does not fully specify the behaviour of localtime_r, upon which getTimeZone relies.  POSIX.1-2008 says:

    Unlike localtime(), the localtime_r() function is not required to set tzname.

"not required" means that localtime_r may or may not set tzname.  MacOS X's behaviour sets tzname on every call to localtime_r.

On the other hand, Linux, using glibc, the behaviour of localtime_r is outstandingly complicated.  Upon the first call to localtime_r (or more techincially upon the first call to tzset_internal) it will set tzname based upon the value in the TZ environment variable, but upon subsequent calls, localtime_r will *not* set the tzname.

This leads to the bizzare behaviour under Linux whereby the value used by getTimeZone (and getCurrentTimeZone) will always use the value of the TZ environment variable during the first call, and it is impossible to change it again.  The only workaround available to a Haskell programer is to call tzset, which is can only be found in another package.

This patch calls tzset() before each call to localtime_r() which forces tzname to be set from the TZ enviroment call.  The result is that on all platforms one gets the sane result of

$ ghc -package time-1.4.1 -e 'System.Posix.Env.putEnv "TZ=EST5EDT" >> Data.Time.getCurrentTimeZone >>= print >> System.Posix.Env.putEnv "TZ=PST8PDT" >> Data.Time.getCurrentTimeZone >>= print'
EDT
PDT

6 years agomore fixing of time.cabal 1_4_0_2
Ashley Yakeley [Sun, 25 Nov 2012 11:22:49 +0000 (11:22 +0000)] 
more fixing of time.cabal

6 years agofix time.cabal
Ashley Yakeley [Sun, 25 Nov 2012 11:12:24 +0000 (11:12 +0000)] 
fix time.cabal

6 years agoupdate haddock for format & parse
Ashley Yakeley [Sun, 25 Nov 2012 10:54:34 +0000 (10:54 +0000)] 
update haddock for format & parse

6 years agotest warning on 32-bit systems
Ashley Yakeley [Sun, 25 Nov 2012 10:18:39 +0000 (10:18 +0000)] 
test warning on 32-bit systems

6 years agofix format modifiers for YCGf
Ashley Yakeley [Sun, 25 Nov 2012 02:23:58 +0000 (02:23 +0000)] 
fix format modifiers for YCGf

6 years agofixed some parsing issues; more test sorting out
Ashley Yakeley [Sat, 24 Nov 2012 11:47:35 +0000 (11:47 +0000)] 
fixed some parsing issues; more test sorting out

6 years agomore test infrastructure
Ashley Yakeley [Thu, 15 Nov 2012 08:52:10 +0000 (08:52 +0000)] 
more test infrastructure

6 years agofix up test infrastructure
Ashley Yakeley [Thu, 15 Nov 2012 04:17:38 +0000 (04:17 +0000)] 
fix up test infrastructure

6 years ago%C not restricted to two characters in format
Ashley Yakeley [Mon, 29 Oct 2012 05:29:37 +0000 (05:29 +0000)] 
%C not restricted to two characters in format

6 years agomore TestInstance clean-up
Ashley Yakeley [Mon, 29 Oct 2012 05:28:49 +0000 (05:28 +0000)] 
more TestInstance clean-up

6 years agoclean up cabal
Ashley Yakeley [Mon, 29 Oct 2012 05:26:12 +0000 (05:26 +0000)] 
clean up cabal

6 years agoclean up tests
Ashley Yakeley [Mon, 29 Oct 2012 00:05:35 +0000 (00:05 +0000)] 
clean up tests

6 years agoget working with Cabal 1.16; fix up build process
Ashley Yakeley [Sun, 21 Oct 2012 23:48:44 +0000 (23:48 +0000)] 
get working with Cabal 1.16; fix up build process

6 years agoadded Test.Tests and Test.TestUtil modules
blackredtree [Thu, 20 Sep 2012 22:41:04 +0000 (22:41 +0000)] 
added Test.Tests and Test.TestUtil modules

6 years agoremoved unneccesary Makefile
blackredtree [Thu, 13 Sep 2012 22:24:52 +0000 (22:24 +0000)] 
removed unneccesary Makefile

6 years agorevamped tests to use the new cabal testing interface
blackredtree [Thu, 13 Sep 2012 22:22:27 +0000 (22:22 +0000)] 
revamped tests to use the new cabal testing interface

tests now use string comparsion instead of diffing to determine test results

.ref files were converted into hs modules exporting the same data

6 years agochanged uses of mkTyCon to mkTyCon3
blackredtree [Thu, 13 Sep 2012 22:00:34 +0000 (22:00 +0000)] 
changed uses of mkTyCon to mkTyCon3

6 years agofix for latest GHC
Ashley Yakeley [Sun, 8 Jul 2012 02:59:16 +0000 (02:59 +0000)] 
fix for latest GHC

7 years agoRULES for realToFrac, for speed, contributed by Liyang HU <haskell.org@liyang.hu>
Ashley Yakeley [Mon, 31 Oct 2011 00:38:00 +0000 (00:38 +0000)] 
RULES for realToFrac, for speed, contributed by Liyang HU <haskell.org@liyang.hu>

7 years agoremove upper bound on deepseq dependency 1_4
Ashley Yakeley [Tue, 13 Sep 2011 09:22:50 +0000 (09:22 +0000)] 
remove upper bound on deepseq dependency

7 years agoNFData instances, contributed by Herbert Valerio Riedel <hvriedel@gmail.com>
Ashley Yakeley [Mon, 12 Sep 2011 10:08:07 +0000 (10:08 +0000)] 
NFData instances, contributed by Herbert Valerio Riedel <hvriedel@gmail.com>

7 years agoversion 1.3: instance RealFrac DiffTime 1_3
Ashley Yakeley [Wed, 10 Aug 2011 02:12:09 +0000 (02:12 +0000)] 
version 1.3: instance RealFrac DiffTime

8 years agocorrect padding in parse; doc 1_2_0_5
Ashley Yakeley [Wed, 11 May 2011 07:40:32 +0000 (07:40 +0000)] 
correct padding in parse; doc

8 years agoversion 1.2.0.5
Ashley Yakeley [Wed, 11 May 2011 06:34:37 +0000 (06:34 +0000)] 
version 1.2.0.5

8 years agoallow - _ 0 modifiers in % parsing
Ashley Yakeley [Sun, 8 May 2011 05:57:59 +0000 (05:57 +0000)] 
allow - _ 0 modifiers in % parsing

8 years agotest parse %-m single digit
Ashley Yakeley [Sun, 8 May 2011 05:31:58 +0000 (05:31 +0000)] 
test parse %-m single digit

8 years agotest parse %d %e single digit
Ashley Yakeley [Sun, 8 May 2011 05:21:09 +0000 (05:21 +0000)] 
test parse %d %e single digit

8 years agotest for parse %m single digit
Ashley Yakeley [Sun, 8 May 2011 05:16:09 +0000 (05:16 +0000)] 
test for parse %m single digit

8 years agoparse %y range 1969 - 2068, bug #2671
Ashley Yakeley [Sun, 8 May 2011 04:36:17 +0000 (04:36 +0000)] 
parse %y range 1969 - 2068, bug #2671

8 years agotest parse %C %y
Ashley Yakeley [Sun, 8 May 2011 04:29:05 +0000 (04:29 +0000)] 
test parse %C %y

8 years agotest for %y parse to 1969 - 2068
Ashley Yakeley [Sun, 8 May 2011 04:22:16 +0000 (04:22 +0000)] 
test for %y parse to 1969 - 2068

8 years agospecify QuickCheck version
Ashley Yakeley [Sun, 8 May 2011 04:21:47 +0000 (04:21 +0000)] 
specify QuickCheck version

8 years ago.run files are boring 1_2_0_4
Ashley Yakeley [Thu, 3 Feb 2011 05:34:07 +0000 (05:34 +0000)] 
.run files are boring

8 years agofix parse "undefined" bug; added TestParseTime into tests
Ashley Yakeley [Thu, 3 Feb 2011 05:32:19 +0000 (05:32 +0000)] 
fix parse "undefined" bug; added TestParseTime into tests

8 years agotest says Success
Ashley Yakeley [Mon, 24 Jan 2011 01:55:11 +0000 (01:55 +0000)] 
test says Success

9 years agoversion 1.2.0.3 is more appropriate than 1.2.1. 1_2_0_3
Ashley Yakeley [Tue, 22 Jun 2010 03:58:47 +0000 (03:58 +0000)] 
version 1.2.0.3 is more appropriate than 1.2.1.

9 years agoset version to 1.2.1
Ashley Yakeley [Mon, 21 Jun 2010 08:35:26 +0000 (08:35 +0000)] 
set version to 1.2.1

9 years agoFixed loss of accuracy in timeOfDayToDayFraction.
Bjorn Buckwalter [Mon, 21 Jun 2010 08:04:47 +0000 (08:04 +0000)] 
Fixed loss of accuracy in timeOfDayToDayFraction.

9 years agoinclude test files in package 1_2_0_2
Ashley Yakeley [Tue, 27 Apr 2010 06:55:11 +0000 (06:55 +0000)] 
include test files in package

9 years ago1.2.0.1, include missing HsConfigure in sdist 1_2_0_1
Ashley Yakeley [Sun, 11 Apr 2010 20:35:07 +0000 (20:35 +0000)] 
1.2.0.1, include missing HsConfigure in sdist

9 years agoget working with both GHC 6.10 and 6.12 1_2
Ashley Yakeley [Sun, 11 Apr 2010 08:26:03 +0000 (08:26 +0000)] 
get working with both GHC 6.10 and 6.12

9 years agofix tests
Ashley Yakeley [Sun, 11 Apr 2010 05:40:58 +0000 (05:40 +0000)] 
fix tests

9 years agoversion 1.2; add Data instance, conditional on support
Ashley Yakeley [Sun, 11 Apr 2010 05:19:39 +0000 (05:19 +0000)] 
version 1.2; add Data instance, conditional on support

9 years agosort out GHC 6.12 warnings
Ashley Yakeley [Sun, 11 Apr 2010 03:34:14 +0000 (03:34 +0000)] 
sort out GHC 6.12 warnings

9 years agocopyright date
Ashley Yakeley [Sun, 11 Apr 2010 03:25:06 +0000 (03:25 +0000)] 
copyright date

9 years agoupdate cabal-version constraint
Ross Paterson [Fri, 17 Jul 2009 16:02:55 +0000 (16:02 +0000)] 
update cabal-version constraint

The syntax 'base == 4.*' requires cabal version 1.6 or later.

9 years agoformatTime: glibc-style modifier flags
Ashley Yakeley [Sat, 11 Jul 2009 08:01:32 +0000 (08:01 +0000)] 
formatTime: glibc-style modifier flags

9 years agoversion 1.1.4
Ashley Yakeley [Sat, 11 Jul 2009 07:50:07 +0000 (07:50 +0000)] 
version 1.1.4

10 years agoadd validating constructors
Ashley Yakeley [Wed, 17 Jun 2009 08:49:36 +0000 (08:49 +0000)] 
add validating constructors

10 years agouse base==4.*
Ashley Yakeley [Wed, 17 Jun 2009 08:48:43 +0000 (08:48 +0000)] 
use base==4.*

10 years agoadd validating converters
Ashley Yakeley [Tue, 2 Jun 2009 06:51:42 +0000 (06:51 +0000)] 
add validating converters

10 years agocap in .cabal
Ashley Yakeley [Tue, 2 Jun 2009 04:04:36 +0000 (04:04 +0000)] 
cap in .cabal

10 years agoTypeable instances for all types
Ashley Yakeley [Mon, 27 Apr 2009 00:48:05 +0000 (00:48 +0000)] 
Typeable instances for all types

10 years agonext version will be 1.1.3
Ashley Yakeley [Mon, 27 Apr 2009 00:07:46 +0000 (00:07 +0000)] 
next version will be 1.1.3

10 years agoget building on Windows
ashley [Fri, 17 Apr 2009 07:58:14 +0000 (07:58 +0000)] 
get building on Windows

10 years agoclean up .cabal; first attempt at Windows compilability
Ashley Yakeley [Fri, 17 Apr 2009 06:36:49 +0000 (06:36 +0000)] 
clean up .cabal; first attempt at Windows compilability

10 years agoCase-insensitive parsing.
Bjorn Buckwalter [Sun, 18 Jan 2009 21:54:47 +0000 (21:54 +0000)] 
Case-insensitive parsing.
Note that when a TimeZone is parsed the timeZoneName is converted to upper case. The capitalization of the input could just as easily be preserved instead. It is unclear whether there is any clear advantage to either option.

10 years agoProperties for testing case-insensitivity.
Bjorn Buckwalter [Sun, 18 Jan 2009 21:51:43 +0000 (21:51 +0000)] 
Properties for testing case-insensitivity.
Note that not all formats being tested have alphabetical characters. The additional testing of those is "wasteful".

10 years agoprop_name helper for defining named properties.
Bjorn Buckwalter [Sun, 18 Jan 2009 01:10:08 +0000 (01:10 +0000)] 
prop_name helper for defining named properties.

10 years agoIx instance for Day. This is useful for e.g. storing daily tabulated data in arrays.
Bjorn Buckwalter [Sun, 30 Nov 2008 02:22:54 +0000 (02:22 +0000)] 
Ix instance for Day. This is useful for e.g. storing daily tabulated data in arrays.

10 years agoadd Makefile for development building; remove OPTIONS -Wall -Werror in each file 1_1_2_3
Ashley Yakeley [Sun, 4 Jan 2009 23:03:18 +0000 (23:03 +0000)] 
add Makefile for development building; remove OPTIONS -Wall -Werror in each file

10 years agofix Julian haddock docs
Ashley Yakeley [Sun, 4 Jan 2009 22:43:39 +0000 (22:43 +0000)] 
fix Julian haddock docs

10 years agofix warnings; fix tests; remove GHC cruft; bump to 1.1.2.3
Ashley Yakeley [Sun, 4 Jan 2009 22:37:28 +0000 (22:37 +0000)] 
fix warnings; fix tests; remove GHC cruft; bump to 1.1.2.3

10 years agoImprove meta-data 1_1_2_2
Don Stewart [Sat, 11 Oct 2008 22:04:12 +0000 (22:04 +0000)] 
Improve meta-data

10 years agoBump version number to 1.1.2.2
Duncan Coutts [Sat, 11 Oct 2008 03:48:01 +0000 (03:48 +0000)] 
Bump version number to 1.1.2.2
Only warning and doc changes since the last release

10 years agoAdd x-follows-version-policy tag
Duncan Coutts [Sat, 11 Oct 2008 03:47:42 +0000 (03:47 +0000)] 
Add x-follows-version-policy tag

10 years agoremove -ffi options (in favour of -XForeignFunctionInterface) 6_10_branch_has_been_forked
Ashley Yakeley [Mon, 15 Sep 2008 00:19:01 +0000 (00:19 +0000)] 
remove -ffi options (in favour of -XForeignFunctionInterface)

10 years agodon't warn about orphan instances; they're real warnings now (i.e. errors with -Werror)
Ashley Yakeley [Tue, 12 Aug 2008 07:35:46 +0000 (07:35 +0000)] 
don't warn about orphan instances; they're real warnings now (i.e. errors with -Werror)

10 years agoChange "accuracy" to "precision".
Alexander Dunlap [Tue, 29 Jul 2008 18:37:58 +0000 (18:37 +0000)] 
Change "accuracy" to "precision".
See <http://www.haskell.org/pipermail/libraries/2008-July/010290.html>.

11 years agoRemove -Wall and -Werror, they don't belong here
Simon Marlow [Thu, 19 Jun 2008 14:12:19 +0000 (14:12 +0000)] 
Remove -Wall and -Werror, they don't belong here
this fixes GHC HEAD right now, which generates a warning for -ffi.

11 years agoBump version to 1.1.2.1 1_1_2_1_release 2008-06-06 GHC_6_8_3_release
Ian Lynagh [Wed, 4 Jun 2008 12:13:53 +0000 (12:13 +0000)] 
Bump version to 1.1.2.1

11 years agoFigure out timezone offset from timezone name
David Leuschner [Sat, 2 Feb 2008 11:33:17 +0000 (11:33 +0000)] 
Figure out timezone offset from timezone name

11 years agodocument how to get a POSIXTime from an EpochTime or CTime.
Simon Marlow [Wed, 5 Dec 2007 09:15:37 +0000 (09:15 +0000)] 
document how to get a POSIXTime from an EpochTime or CTime.

11 years agoBump version number 1_1_2_0_release 2007-11-11 GHC_6_8_1_release
Ian Lynagh [Sat, 27 Oct 2007 12:49:20 +0000 (12:49 +0000)] 
Bump version number

11 years agoUse configurations to allow building with ghc-6.6, 6.8
Duncan Coutts [Thu, 18 Oct 2007 17:38:27 +0000 (17:38 +0000)] 
Use configurations to allow building with ghc-6.6, 6.8
Specify build-type: Custom since there is test code in Setup.hs

11 years agoHaddock for parseTime and friends.
bjorn [Tue, 16 Oct 2007 20:19:31 +0000 (20:19 +0000)] 
Haddock for parseTime and friends.

11 years agoDocument the format used for output with %z.
bjorn [Tue, 16 Oct 2007 19:54:49 +0000 (19:54 +0000)] 
Document the format used for output with %z.

11 years agoAllow a colon between the hours and minutes when parsing with %z and %Z.
bjorn [Tue, 16 Oct 2007 19:52:39 +0000 (19:52 +0000)] 
Allow a colon between the hours and minutes when parsing with %z and %Z.

11 years agoFixed Cabal-induced breakage, once again...
sven.panne [Sat, 8 Sep 2007 16:02:56 +0000 (16:02 +0000)] 
Fixed Cabal-induced breakage, once again...
MERGE TO STABLE (if we have a concept of "stable libraries")

11 years agoTrack .cabal syntax changes once again
sven.panne [Sat, 1 Sep 2007 15:47:28 +0000 (15:47 +0000)] 
Track .cabal syntax changes once again

11 years agoUse configurations rather than Setup.hs hacks
Ian Lynagh [Sun, 29 Jul 2007 21:38:33 +0000 (21:38 +0000)] 
Use configurations rather than Setup.hs hacks

11 years agoFIX #1486: timezone offset has the wrong sign on Windows
Simon Marlow [Tue, 10 Jul 2007 08:12:36 +0000 (08:12 +0000)] 
FIX #1486: timezone offset has the wrong sign on Windows
Fix submitted by Olivier Boudry, thanks!

11 years agoProvide a configure flag to set which C compiler is used
Ian Lynagh [Sat, 7 Jul 2007 11:24:51 +0000 (11:24 +0000)] 
Provide a configure flag to set which C compiler is used

12 years ago#undef PACKAGE_NAME and friends to avoid clashes
Simon Marlow [Wed, 6 Jun 2007 14:20:42 +0000 (14:20 +0000)] 
#undef PACKAGE_NAME and friends to avoid clashes

12 years ago--configure-option and --ghc-option are now provided by Cabal
Ross Paterson [Mon, 4 Jun 2007 11:55:55 +0000 (11:55 +0000)] 
--configure-option and --ghc-option are now provided by Cabal

12 years agoFollow base split (now dep on old-locale)
Ian Lynagh [Thu, 24 May 2007 17:37:51 +0000 (17:37 +0000)] 
Follow base split (now dep on old-locale)

12 years agoRemove Makefile and package.conf.in (used in the old GHC build system)
Ian Lynagh [Thu, 24 May 2007 14:58:37 +0000 (14:58 +0000)] 
Remove Makefile and package.conf.in (used in the old GHC build system)

12 years agoBump version to 1.1.1 1_1_1_release GHC_6_6_1_release Version_1_1_1
Ian Lynagh [Sun, 22 Apr 2007 19:52:28 +0000 (19:52 +0000)] 
Bump version to 1.1.1

12 years agoWe now need to check the exitcode of the tests
Ian Lynagh [Sat, 21 Apr 2007 16:23:30 +0000 (16:23 +0000)] 
We now need to check the exitcode of the tests

12 years agoFollow Cabal changes in Setup.*hs
Ian Lynagh [Wed, 18 Apr 2007 12:14:32 +0000 (12:14 +0000)] 
Follow Cabal changes in Setup.*hs

12 years agoHack due to time needing Win32 on Windows
Ian Lynagh [Sun, 15 Apr 2007 21:52:27 +0000 (21:52 +0000)] 
Hack due to time needing Win32 on Windows

12 years agoFix -Wall warnings
Ian Lynagh [Wed, 11 Apr 2007 01:22:40 +0000 (01:22 +0000)] 
Fix -Wall warnings