Пример #1
0
        public override LocalDate Decode(byte[] bytes)
        {
            var decode = LongSchema.Of().Decode(bytes);

            return(LocalDate.FromDateTime(DateTimeOffset.FromUnixTimeMilliseconds(decode).DateTime));
        }
Пример #2
0
        public override byte[] Encode(Instant message)
        {
            long epochDay = message.ToDateTimeOffset().ToUnixTimeMilliseconds();

            return(LongSchema.Of().Encode(epochDay));
        }
Пример #3
0
        public override byte[] Encode(LocalDate message)
        {
            long epochDay = (long)(message.ToDateTimeUnspecified() - _epoch).TotalMilliseconds;

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