<commit_before>package types

import (
	"time"
)

func Time2Millis(t time.Time, adjustedToUTC bool) int64 {
	return Time2Micros(t, adjustedToUTC) / 1000
}

func Millis2Time(millis int64, adjustedToUTC bool) time.Time {
	return Micros2Time(millis * 1000, adjustedToUTC)
} 

func Time2Micros(t time.Time, adjustedToUTC bool) int64 {
	return Time2Nanos(t, adjustedToUTC) / 1000
}

func Micros2Time(micros int64, adjustedToUTC bool) time.Time {
	return Nanos2Time(micros * 1000, adjustedToUTC)
}

func Time2Nanos(t time.Time, adjustedToUTC bool) int64 {
	if adjustedToUTC {
		return t.UnixNano()
	} else {
		epoch := time.Date(1970, 1, 1, 0, 0, 0, 0, t.Location())
		return t.Sub(epoch).Nanoseconds()
	}
}

func Nanos2Time(nanos int64, adjustedToUTC bool) time.Time {
	if adjustedToUTC {
		return time.Unix(0, nanos).UTC()

	}else{
		epoch := time.Date(1970, 1, 1, 0, 0, 0, 0, time.Local)
		t := epoch.Add(time.Nanosecond * time.Duration(nanos))
		return t
	}
}

func Time2INT96(t time.Time) string {

}

func INT962Time(int96 string) time.Time {

}<commit_msg>add convert func<commit_after>package types

import (
	"time"
	"encoding/binary"
)

func TimeToTIME_MILLIS(t time.Time, adjustedToUTC bool) int64 {
	return TimeToTIME_MICROS(t, adjustedToUTC) / 1000
}

func TimeToTIME_MICROS(t time.Time, adjustedToUTC bool) int64 {
	if adjustedToUTC {
		tu := t.UTC()
		h, m, s, ns := int64(tu.Hour()), int64(tu.Minute()), int64(tu.Second()), int64(tu.Nanosecond())
		nanos := h * int64(time.Hour) + m * int64(time.Minute) + s * int64(time.Second) + ns * int64(time.Nanosecond)
		return nanos / 1000

	} else {
		h, m, s, ns := int64(t.Hour()), int64(t.Minute()), int64(t.Second()), int64(t.Nanosecond())
		nanos := h * int64(time.Hour) + m * int64(time.Minute) + s * int64(time.Second) + ns * int64(time.Nanosecond)
		return nanos / 1000
	}
}

func TimeToTIMESTAMP_MILLIS(t time.Time, adjustedToUTC bool) int64 {
	return TimeToTIMESTAMP_MICROS(t, adjustedToUTC) / 1000
}

func TIMESTAMP_MILLISToTime(millis int64, adjustedToUTC bool) time.Time {
	return TIMESTAMP_MICROSToTime(millis * 1000, adjustedToUTC)
} 

func TimeToTIMESTAMP_MICROS(t time.Time, adjustedToUTC bool) int64 {
	return TimeToTIMESTAMP_NANOS(t, adjustedToUTC) / 1000
}

func TIMESTAMP_MICROSToTime(micros int64, adjustedToUTC bool) time.Time {
	return TIMESTAMP_NANOSToTime(micros * 1000, adjustedToUTC)
}

func TimeToTIMESTAMP_NANOS(t time.Time, adjustedToUTC bool) int64 {
	if adjustedToUTC {
		return t.UnixNano()
	} else {
		epoch := time.Date(1970, 1, 1, 0, 0, 0, 0, t.Location())
		return t.Sub(epoch).Nanoseconds()
	}
}

func TIMESTAMP_NANOSToTime(nanos int64, adjustedToUTC bool) time.Time {
	if adjustedToUTC {
		return time.Unix(0, nanos).UTC()

	}else{
		epoch := time.Date(1970, 1, 1, 0, 0, 0, 0, time.Local)
		t := epoch.Add(time.Nanosecond * time.Duration(nanos))
		return t
	}
}

func TimeToINT96(t time.Time) string {
	return ""
}

func INT96ToTime(int96 string) time.Time {
	nano := binary.LittleEndian.Uint64([]byte(int96[:8]))
	dt := binary.LittleEndian.Uint32([]byte(int96[8:]))

	l := dt + 68569
	n := 4 * l / 146097
	l = l - (146097*n+3)/4
	i := 4000 * (l + 1) / 1461001
	l = l - 1461*i/4 + 31
	j := 80 * l / 2447
	k := l - 2447*j/80
	l = j / 11
	j = j + 2 - 12*l
	i = 100*(n-49) + i + l
	tm := time.Date(int(i), time.Month(j), int(k), 0, 0, 0, 0, time.UTC)
	tm = tm.Add(time.Duration(nano))
	return tm
}
{'fraction_non_alphanumeric': 0.14559952746603663, 'fraction_numerical': 0.07235676314235086, 'mean_word_length': 4.251162790697674, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '613316', 'n_tokens_mistral': 1596, 'n_tokens_neox': 1381, 'n_words': 319}