Esempio n. 1
0
        public override LocalDate Decode(byte[] bytes)
        {
            var decode = LongSchema.Of().Decode(bytes);

            return(LocalDate.FromDateTime(DateTimeOffset.FromUnixTimeMilliseconds(decode).DateTime));
        }
Esempio n. 2
0
        public override byte[] Encode(Instant message)
        {
            long epochDay = message.ToDateTimeOffset().ToUnixTimeMilliseconds();

            return(LongSchema.Of().Encode(epochDay));
        }
Esempio n. 3
0
        public override byte[] Encode(LocalDate message)
        {
            long epochDay = (long)(message.ToDateTimeUnspecified() - _epoch).TotalMilliseconds;

            return(LongSchema.Of().Encode(epochDay));
        }