# module Time::EpochMillisConverter

##
Overview

Converter to be used with `JSON.mapping` and `YAML.mapping` to serialize a `Time` instance as the number of milliseconds since the unix epoch. See `Time#to_unix_ms`.

    require "json"

    class Timestamp
      JSON.mapping({
        value: {type: Time, converter: Time::EpochMillisConverter},
      })
    end

    timestamp = Timestamp.from_json(%({"value": 1459860483856}))
    timestamp.value   # => 2016-04-05 12:48:03.856 UTC
    timestamp.to_json # => %({"value":1459860483856})

##
Defined in:

##
Class Method Summary

- .from_json(value : JSON::PullParser) : Time
- .from_yaml(ctx : YAML::ParseContext, node : YAML::Nodes::Node) : Time
- .to_json(value : Time, json : JSON::Builder)
- .to_yaml(value : Time, yaml : YAML::Nodes::Builder)

##
Class Method Detail

def self.from_json(value : JSON::PullParser) : Time #
def self.from_yaml(ctx : YAML::ParseContext, node : YAML::Nodes::Node) : Time #
def self.to_json(value : Time, json : JSON::Builder) #
def self.to_yaml(value : Time, yaml : YAML::Nodes::Builder) #