atlas-cardano-0.5.0: Application backend for Plutus smart contracts on Cardano
Copyright(c) 2023 GYELD GMBH
LicenseApache 2.0
Maintainer[email protected]
Stabilitydevelop
Safe HaskellSafe-Inferred
LanguageGHC2021

GeniusYield.Types.Time

Description

 
Synopsis

Documentation

class FormatTime t where Source #

Methods

formatCharacterBoolCharMaybe (FormatOptions → t → String) Source #

Since: time-1.9.1

Instances

Instances details
FormatTime DotNetTime 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

formatCharacterBoolCharMaybe (FormatOptions → DotNetTimeString) Source #

FormatTime GYTime # 
Instance details

Defined in GeniusYield.Types.Time

Methods

formatCharacterBoolCharMaybe (FormatOptions → GYTimeString) Source #

class ParseTime t where Source #

The class of types which can be parsed given a UNIX-style time format string.

Minimal complete definition

parseTimeSpecifier, buildTime

Methods

substituteTimeSpecifierProxy t → TimeLocaleCharMaybe String Source #

Since: time-1.9.1

parseTimeSpecifierProxy t → TimeLocaleMaybe ParseNumericPadding → CharReadP String Source #

Get the string corresponding to the given format specifier.

Since: time-1.9.1

buildTime Source #

Arguments

TimeLocale

The time locale.

→ [(Char, String)]

Pairs of format characters and the corresponding part of the input.

Maybe t 

Builds a time value from a parsed input string. If the input does not include all the information needed to construct a complete value, any missing parts should be taken from 1970-01-01 00:00:00 +0000 (which was a Thursday). In the absence of %C or %Y, century is 1969 - 2068.

Since: time-1.9.1

Instances

Instances details
ParseTime GYTime # 
Instance details

Defined in GeniusYield.Types.Time

gyIso8601ShowGYTimeString #

>>> gyIso8601Show (timeFromPlutus 0)
"1970-01-01T00:00:00Z"

gyIso8601ParseMMonadFail m ⇒ String → m GYTime #

>>> gyIso8601ParseM @Maybe "1970-01-01T00:00:33.333Z"
Just (GYTime 33.333s)
>>> gyIso8601ParseM @Maybe "1970-01-01T00:00:33.333"
Nothing

data GYTime #

Instances

Instances details
FromJSON GYTime #
>>> Aeson.eitherDecode @GYTime "\"1970-01-01T00:00:00Z\""
Right (GYTime 0s)
>>> Aeson.eitherDecode @GYTime "\"1970-01-01T00:00:00\""
Left "Error in $: can't parse '1970-01-01T00:00:00' as GYTime in ISO8601 format"
Instance details

Defined in GeniusYield.Types.Time

ToJSON GYTime #
>>> LBS8.putStrLn $ Aeson.encode $ timeFromPlutus 0
"1970-01-01T00:00:00Z"
Instance details

Defined in GeniusYield.Types.Time

IsString GYTime #
>>> "1970-01-01T00:00:00Z" :: GYTime
GYTime 0s
>>> "1970-01-01T00:00:00" :: GYTime
*** Exception: can't parse '1970-01-01T00:00:00' as GYTime in ISO8601 format
...
Instance details

Defined in GeniusYield.Types.Time

Read GYTime # 
Instance details

Defined in GeniusYield.Types.Time

Show GYTime # 
Instance details

Defined in GeniusYield.Types.Time

PrintfArg GYTime #
>>> printf "%s\n" $ timeFromPlutus 1000
1970-01-01T00:00:01Z
Instance details

Defined in GeniusYield.Types.Time

FromField GYTime #
>>> Csv.runParser $ Csv.parseField @GYTime "1970-01-01T00:00:00Z"
Right (GYTime 0s)
>>> Csv.runParser $ Csv.parseField @GYTime "not a time"
Left "can't parse 'not a time' as GYTime in ISO8601 format"
Instance details

Defined in GeniusYield.Types.Time

ToField GYTime #
>>> Csv.toField @GYTime "1970-01-01T00:00:00Z"
"1970-01-01T00:00:00Z"
Instance details

Defined in GeniusYield.Types.Time

Methods

toFieldGYTimeField Source #

Eq GYTime # 
Instance details

Defined in GeniusYield.Types.Time

Methods

(==)GYTimeGYTimeBool Source #

(/=)GYTimeGYTimeBool Source #

Ord GYTime # 
Instance details

Defined in GeniusYield.Types.Time

FromHttpApiData GYTime #
>>> Web.parseUrlPiece @GYTime "1970-01-01T00:00:00Z"
Right (GYTime 0s)
>>> Web.parseUrlPiece @GYTime "1970-01-01T00:00:00"
Left "can't parse '1970-01-01T00:00:00' as GYTime in ISO8601 format"
Instance details

Defined in GeniusYield.Types.Time

ToHttpApiData GYTime #
>>> Web.toUrlPiece $ timeFromPlutus 0
"1970-01-01T00:00:00Z"
Instance details

Defined in GeniusYield.Types.Time

ToParamSchema GYTime # 
Instance details

Defined in GeniusYield.Types.Time

ToSchema GYTime # 
Instance details

Defined in GeniusYield.Types.Time

FormatTime GYTime # 
Instance details

Defined in GeniusYield.Types.Time

Methods

formatCharacterBoolCharMaybe (FormatOptions → GYTimeString) Source #

ParseTime GYTime # 
Instance details

Defined in GeniusYield.Types.Time

timeFromPlutusPOSIXTimeGYTime #

>>> timeFromPlutus 12345
GYTime 12.345s

timeToPlutusGYTimePOSIXTime #

>>> timeToPlutus $ timeFromPlutus 31415
POSIXTime {getPOSIXTime = 31415}

timeToPOSIXGYTimePOSIXTime #

>>> timeToPOSIX (timeFromPOSIX 12346)
12346s

timeFromPOSIXPOSIXTimeGYTime #

>>> timeFromPOSIX 12346
GYTime 12346s