package driver

import (
	
	
)

// Convert a string in [time.RFC3339Nano] format into a [time.Time]
// if it roundtrips back to the same string.
// This way times can be persisted to, and recovered from, the database,
// but if a string is needed, [database/sql] will recover the same string.
func maybeTime( []byte) ( time.Time,  bool) {
	// Weed out (some) values that can't possibly be
	// [time.RFC3339Nano] timestamps.
	if len() < len("2006-01-02T15:04:05Z") {
		return
	}
	if len() > len(time.RFC3339Nano) {
		return
	}
	if [4] != '-' || [10] != 'T' || [16] != ':' {
		return
	}

	// Slow path.
	var  [len(time.RFC3339Nano)]byte
	,  := time.Parse(time.RFC3339Nano, string())
	if  == nil && bytes.Equal(, .AppendFormat([:0], time.RFC3339Nano)) {
		return , true
	}
	return
}