logo

New Response

« Return to the blog entry

You are replying to:

  1. The formula version I came up with. Please let me know if you see anything wrong or have any ideas to improve on it:

    diff_in_seconds:=@Now - datYourFieldName;

    @If(@Sign(diff_in_seconds)=-1;future:=@True;future:=@False);

    @If(future;whichWay:= " away";whichWay:= " ago");

    diff_in_minutes:=@Round(@Abs(diff_in_seconds)/60);

    @If(

    diff_in_minutes >= 0 & diff_in_minutes <= 1; since:="about a minute";

    diff_in_minutes >= 2 & diff_in_minutes <= 44;since:=@Text(diff_in_minutes) & " minutes";

    diff_in_minutes >= 45 & diff_in_minutes <= 89;since:= "about 1 hour";

    diff_in_minutes >= 90 & diff_in_minutes <= 1439;since:= "about " + @Text(@Round(@Abs(diff_in_minutes)/60)) + " hours";

    diff_in_minutes >= 1440 & diff_in_minutes <= 2879;since:= "1 day";

    diff_in_minutes >= 2880 & diff_in_minutes <= 43199;since:= "about " + @Text(@Round(@Abs(diff_in_minutes)/1440)) + " days";

    diff_in_minutes >= 43200 & diff_in_minutes <= 86399;since:= "about 1 month";

    diff_in_minutes >= 86400 & diff_in_minutes <= 525599;since:= "about " + @Text(@Round(@Abs(diff_in_minutes)/43200)) + " months";

    diff_in_minutes >= 525600& diff_in_minutes <= 1051199;since:= "about 1 year";

    since:="over " + @Text(@Round(@Abs(diff_in_minutes)/525600)) + " years" );

    since + whichWay

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: