Example #1
0
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            if (value == null)
            {
                return;
            }
            if (!(value is DateTime))
            {
                throw new InvalidOperationException("This must be used on DateTime objects");
            }

            writer.WriteRawValue(_converter.GetUnixTimestamp((DateTime)value).ToString());
        }