Skip to content

Instantly share code, notes, and snippets.

@lennartkoopmann
Created February 22, 2012 14:49
Show Gist options
  • Save lennartkoopmann/1885408 to your computer and use it in GitHub Desktop.
Save lennartkoopmann/1885408 to your computer and use it in GitHub Desktop.
// Set createdAt to provided timestamp - Set to current time if not set.
double timestamp = this.jsonToDouble(json.get("timestamp"));
if (timestamp <= 0) {
this.message.setCreatedAt(Tools.getUTCTimestampWithMilliseconds());
} else {
this.message.setCreatedAt(timestamp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment