package gojay

import (
	
)

// DecodeTime decodes time with the given format
func ( *Decoder) ( *time.Time,  string) error {
	if .isPooled == 1 {
		panic(InvalidUsagePooledDecoderError("Invalid usage of pooled decoder"))
	}
	return .decodeTime(, )
}

func ( *Decoder) ( *time.Time,  string) error {
	if  == time.RFC3339 {
		var  = make(EmbeddedJSON, 0, 20)
		if  := .decodeEmbeddedJSON(&);  != nil {
			return 
		}
		if  := .UnmarshalJSON();  != nil {
			return 
		}
		return nil
	}
	var  string
	if  := .decodeString(&);  != nil {
		return 
	}
	,  := time.Parse(, )
	if  != nil {
		return 
	}
	* = 
	return nil
}

// Add Values functions

// AddTime decodes the JSON value within an object or an array to a *time.Time with the given format
func ( *Decoder) ( *time.Time,  string) error {
	return .Time(, )
}

// Time decodes the JSON value within an object or an array to a *time.Time with the given format
func ( *Decoder) ( *time.Time,  string) error {
	 := .decodeTime(, )
	if  != nil {
		return 
	}
	.called |= 1
	return nil
}