Eve icon indicating copy to clipboard operation
Eve copied to clipboard

Need a set of time conversion functions

Open cmontella opened this issue 8 years ago • 3 comments

Eve needs functions to convert different time representations e.g. a timestamp into a [day month year ...], or into a string e.g. October 10th 2016.

cmontella avatar Nov 17 '16 02:11 cmontella

Cool. Do you have a suggested API for this?

For example , something like this? (throwing ideas here - not sure what's the naming convention)

date = toDate[timestamp: 1479353359]

datestring = toDateString[date: [day: 16 month: 11: year: 2016]]

olafleur avatar Nov 17 '16 03:11 olafleur

Well, we have plans for a general convert function. This could fit in there. For instance

converted-value = convert[value, from: "time-stamp", to: "time-string"]

Which could be used in other places as well:

converted-value = convert[value, from: "meters", to: "feet"]

cmontella avatar Nov 17 '16 18:11 cmontella

I think the convert function is general is a good idea, but we need to think more about converting time formats, because it's apparently very hairy. The last thing we want to do is support our own time conversion library, so we'll need something already that conforms to time conversion standards.

cmontella avatar Nov 22 '16 23:11 cmontella