Hi @ostap ! Welcome to the Amplitude Community I’m happy to help!
I checked internally and found that you can get around this by doing DATE_TIME_FORMATTER (PROPERTY , "s","yyyy/MM/dd")
.
This help doc page describes how to use the DATE_TIME_FORMATTER
function. In this case, I am telling the formatter we are getting a value in seconds (“s”), and I want a return format like 2021/04/21 (“yyyy/MM/dd”).
If you want to output to look like the LONG_TO_TIME
function, then this “YYYY-MM-dd HHss” should be the output format.
Can you try the above and let me know how that works for you?
Thank you, Belinda. It worked as expected!
Didn’t know about that `”s”` functionality in SimpleDateFormat. Thanks for sharing that internal workaround.
@ostap Glad to hear that it worked and you’re very welcome! :)
Our Derived Properties doc does have a handy link to the SimpleDateFormat functionality list. I’m going to share it here in case other Community members find it useful: https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
I agree with OP that a STRING_TO_NUMBER function would be useful.
Im my case I want to use "split" to pull a value from a longer string, then use math functions on it.
Hi @Jacobt ! Thanks for your suggestion and I think this would be a great add to our Product Ideas page: https://community.amplitude.com/ideas Can you share your feedback here?