-
-
Save schovi/3207349 to your computer and use it in GitHub Desktop.
Test of converting UTCTime to sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schovi@Connie~/tmp/haskell$ ghci | |
GHCi, version 7.4.2: http://www.haskell.org/ghc/ :? for help | |
Loading package ghc-prim ... linking ... done. | |
Loading package integer-gmp ... linking ... done. | |
Loading package base ... linking ... done. | |
Prelude> :l time | |
[1 of 1] Compiling Main ( time.hs, interpreted ) | |
Ok, modules loaded: Main. | |
*Main> date | |
Loading package array-0.4.0.0 ... linking ... done. | |
Loading package deepseq-1.3.0.0 ... linking ... done. | |
Loading package old-locale-1.0.0.4 ... linking ... done. | |
Loading package time-1.4 ... linking ... done. | |
Loading package old-time-1.1.0.0 ... linking ... done. | |
Loading package containers-0.4.2.1 ... linking ... done. | |
Loading package bytestring-0.9.2.1 ... linking ... done. | |
Loading package time-1.4.0.1 ... | |
GHCi runtime linker: fatal error: I found a duplicate definition for symbol | |
_get_current_timezone_seconds | |
whilst processing object file | |
/Users/schovi/Library/Haskell/ghc-7.4.2/lib/time-1.4.0.1/lib/HStime-1.4.0.1.o | |
This could be caused by: | |
* Loading two different object files which export the same symbol | |
* Specifying the same object file twice on the GHCi command line | |
* An incorrect `package.conf' entry, causing some object to be | |
loaded twice. | |
GHCi cannot safely continue in this situation. Exiting now. Sorry. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Time | |
import System.Locale | |
import Database.HDBC (toSql, fromSql, run, runRaw, quickQuery', commit) | |
date :: UTCTime | |
date = readTime defaultTimeLocale "%d.%m.%Y" "29.07.2012" | |
main = print date | |
--test = toSql date |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment