Date in relative format


I’m trying to display the date in relative format. I’m looking at Xojo documentation but I can’t find anything related.

Which is the best way to display date in relative format?

Thank you.

Hi Jose,
There’s nothing built in that I’m aware of, but I do offer GraffitiLocale as part of GraffitiSuite Web and Desktop which can give you relatively formatted date strings by comparison and return something like “1 day ago” or “2 years ago”.

1 Like

WebListBox has a Relative style in it’s WebListBoxDateTimeRenderer see


Its for desktop, so I will try GraffitiSuite.


1 Like

though I have issues reading the date value back, have you found out how to do that? Seems that the renderer is storing a JSON(-esque) file …


If I was going to want to read the data I would put it in a celltag when adding the row to the listbox. However timestamp appears to be SecondsFrom1970, so dt As New DateTime(timestamp, New Timezone(tzoffset)) should give you the answer.


Thank you. Yes cell tag would be a good option but I wrote a method for it as I need something else in cell tag for this particular case:

var content As New JSONItem
content.Load( dateStr )
var timestamp as double = content.Value("timestamp").DoubleValue
var foundDate as new dateTime( timestamp )

return foundDate