- data UnixTime = UnixTime {
- utSeconds :: !CTime
- utMicroSeconds :: !Int32
- getUnixTime :: IO UnixTime
- parseUnixTime :: Format -> ByteString -> UnixTime
- parseUnixTimeGMT :: Format -> ByteString -> UnixTime
- formatUnixTime :: Format -> UnixTime -> ByteString
- formatUnixTimeGMT :: Format -> UnixTime -> ByteString
- type Format = ByteString
- webDateFormat :: Format
- mailDateFormat :: Format
- data UnixDiffTime
- diffUnixTime :: UnixTime -> UnixTime -> UnixDiffTime
- addUnixDiffTime :: UnixTime -> UnixDiffTime -> UnixTime
- secondsToUnixDiffTime :: Integral a => a -> UnixDiffTime
- microSecondsToUnixDiffTime :: Integral a => a -> UnixDiffTime
- fromEpochTime :: EpochTime -> UnixTime
- toEpochTime :: UnixTime -> EpochTime
- fromClockTime :: ClockTime -> UnixTime
- toClockTime :: UnixTime -> ClockTime
Data structure
Data structure for Unix time.
UnixTime | |
|
Getting time
getUnixTime :: IO UnixTimeSource
Getting UnixTime
from OS.
Parsing and formatting time
parseUnixTime :: Format -> ByteString -> UnixTimeSource
Parsing ByteString
to UnixTime
interpreting as localtime.
Zone in Format
(%Z or %z) would be ignored.
This is a wrapper for strptime_l().
parseUnixTimeGMT :: Format -> ByteString -> UnixTimeSource
Parsing ByteString
to UnixTime
interpreting as GMT.
Zone in Format
(%Z or %z) would be ignored.
This is a wrapper for strptime_l().
formatUnixTime :: Format -> UnixTime -> ByteStringSource
Formatting UnixTime
to ByteString
in local time.
This is a wrapper for strftime_l().
formatUnixTimeGMT :: Format -> UnixTime -> ByteStringSource
Formatting UnixTime
to ByteString
in GMT.
This is a wrapper for strftime_l().
type Format = ByteStringSource
Format of the strptime()/strftime() style.
Format for web (RFC 2616).
This should be used with formatUnixTimeGMT
.
mailDateFormat :: FormatSource
Format for e-mail (RFC 5322).
This should be used with formatUnixTime
.
Difference time
data UnixDiffTime Source
Data structure for UnixTime diff.
Eq UnixDiffTime | |
Num UnixDiffTime | Arithmetic operations where (1::UnixDiffTime) means 1 second. |
Ord UnixDiffTime | |
Real UnixDiffTime | |
Show UnixDiffTime |
diffUnixTime :: UnixTime -> UnixTime -> UnixDiffTimeSource
Calculating difference between two UnixTime
.
addUnixDiffTime :: UnixTime -> UnixDiffTime -> UnixTimeSource
Adding difference to UnixTime
.
secondsToUnixDiffTime :: Integral a => a -> UnixDiffTimeSource
Creating difference from seconds.
microSecondsToUnixDiffTime :: Integral a => a -> UnixDiffTimeSource
Creating difference from micro seconds.
Translating time
fromEpochTime :: EpochTime -> UnixTimeSource
From EpochTime
to UnixTime
setting utMicroSeconds
to 0.
toEpochTime :: UnixTime -> EpochTimeSource
From UnixTime
to EpochTime
ignoring utMicroSeconds
.