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 (opens new window)

# Public Properties

Property Description
description string (opens new window)
name string (opens new window)
setToSystemTimeZone boolean (opens new window) โ€“ Whether parsed dates should be set to the system time zone

# description

Type
string (opens new window)
Default value
'TheDateTimescalar type represents a point in time.'

View source (opens new window)

# name

Type
string (opens new window)
Default value
'DateTime'

View source (opens new window)

# setToSystemTimeZone

Type
boolean (opens new window)
Default value
true
Since
4.5.11

Whether parsed dates should be set to the system time zone

View source (opens new window)

# Public Methods

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

# getName()

View source (opens new window)

Returns

string (opens new window)

# getType()

Returns a singleton instance to ensure one type per schema.

View source (opens new window)

Returns

craft\gql\types\DateTime

# parseLiteral()

View source (opens new window)

Arguments

  • $valueNode
  • $variables

# parseValue()

View source (opens new window)

Arguments

  • $value

# serialize()

View source (opens new window)

Arguments

  • $value