Skip to content
Advertisement

Tag: unix-timestamp

Gson dateformat to serialize/deserialize unix-timestamps

I am using Gson to serialize/deserialize my pojos and currently looking for a clean way to tell Gson to parse/output date attributes as unix-timestamps. Here’s my attempt: Comming from PHP where “U” is the dateformat used to serialize/deserialize date as unix-timestamps, when running my attempt code, I am a RuntimeException: Unknown pattern character ‘U’ I am assuming that Gson uses

Advertisement