package gojay

import (
	
)

// EncodeTime encodes a *time.Time to JSON with the given format
func ( *Encoder) ( *time.Time,  string) error {
	if .isPooled == 1 {
		panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
	}
	_, _ = .encodeTime(, )
	,  := .Write()
	if  != nil {
		return 
	}
	return nil
}

// encodeInt encodes an int to JSON
func ( *Encoder) ( *time.Time,  string) ([]byte, error) {
	.writeByte('"')
	.buf = .AppendFormat(.buf, )
	.writeByte('"')
	return .buf, nil
}

// AddTimeKey adds an *time.Time to be encoded with the given format, must be used inside an object as it will encode a key
func ( *Encoder) ( string,  *time.Time,  string) {
	.TimeKey(, , )
}

// TimeKey adds an *time.Time to be encoded with the given format, must be used inside an object as it will encode a key
func ( *Encoder) ( string,  *time.Time,  string) {
	if .hasKeys {
		if !.keyExists() {
			return
		}
	}
	.grow(10 + len())
	 := .getPreviousRune()
	if  != '{' {
		.writeTwoBytes(',', '"')
	} else {
		.writeByte('"')
	}
	.writeStringEscape()
	.writeBytes(objKeyStr)
	.buf = .AppendFormat(.buf, )
	.writeByte('"')
}

// AddTime adds an *time.Time to be encoded with the given format, must be used inside a slice or array encoding (does not encode a key)
func ( *Encoder) ( *time.Time,  string) {
	.Time(, )
}

// Time adds an *time.Time to be encoded with the given format, must be used inside a slice or array encoding (does not encode a key)
func ( *Encoder) ( *time.Time,  string) {
	.grow(10)
	 := .getPreviousRune()
	if  != '[' {
		.writeByte(',')
	}
	.writeByte('"')
	.buf = .AppendFormat(.buf, )
	.writeByte('"')
}