Skip to content

Instantly share code, notes, and snippets.

View scruffyfox's full-sized avatar
🏳️‍🌈
+++

Callum Taylor scruffyfox

🏳️‍🌈
+++
  • UK
View GitHub Profile
/*
* Copyright (C) 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@scruffyfox
scruffyfox / gist:1333916
Created November 2, 2011 15:23 — forked from codeincontext/gist:1285806
Javascript function to show how long ago a timestamp was as a pretty string
/**
* Converts a timestamp to how long ago syntax
* @param time The time in seconds
* @return The formatted time
*/
public static String timeAgo(int time)
{
Unit[] units = new Unit[]
{
new Unit("s", 60, 1),