I want to use the icu_date library, but when I try to insert a value, an error appears
icu_date = require("icu-date")
format_date = icu_date.formats.iso8601()
end_time = icu_date.now()
1602586287098 - print value
end_time:set_millis(1602461532000)
error: '[string "return end_time:set_millis(1602461532000)"]:1: attempt to index global ''end_time'' (a number value)'
Maybe there are not enough libraries?
- Library libicu-devel-50.2-4.el7_7.x86_64
- System: Centos 7
Seems you need to use
icu_date.new()
(notnow
) to create new instance. Then you can use it in the way you want:icu_date.now()
returns current time. That's actually a number value.