Skip to content

DateTime ​

Type
Class
Namespace
craft\gql\types
Inherits
craft\gql\types\DateTime » GraphQL\Type\Definition\ScalarType
Implements
craft\gql\base\SingularTypeInterface
Since
3.3.0

Class DateTime implements the Datetime scalar type for GraphQL.

View source

Public Properties ​

PropertyDescription
descriptionstring
namestring
setToSystemTimeZoneboolean – Whether parsed dates should be set to the system time zone

description ​

Type
string
Default value
'The DateTime scalar type represents a point in time.'

View source

name ​

Type
string
Default value
'DateTime'

View source

setToSystemTimeZone ​

Type
boolean
Default value
true
Since
4.5.11

Whether parsed dates should be set to the system time zone

View source

Public Methods ​

MethodDescription
getName()
getType()Returns a singleton instance to ensure one type per schema.
parseLiteral()
parseValue()
serialize()

getName() ​

View source

Returns ​

string

getType() ​

Returns a singleton instance to ensure one type per schema.

View source

Returns ​

craft\gql\types\DateTime

parseLiteral() ​

View source

Arguments ​

  • $valueNode
  • $variables

parseValue() ​

View source

Arguments ​

  • $value

serialize() ​

View source

Arguments ​

  • $value