Timespan#getAs(TimePeriod) truncates to Integer, breaking larger timespans.
Diclo opened this issue ยท 8 comments
Skript/Server Version
Server: 1.21-75
Skript: Skript-2.9.0
Bug Description
The time subtraction function isn't working.
script:
set {_pcd} to skutil yaml value "cd.%{_tipo}%" of file "{@file}"
send "%nl% Tiempo guardado: %{_pcd}% %nl%" to console
set {_pcd} to "%{_pcd}% seconds" parsed as timespan
send "%nl% Tiempo convertido: %{_pcd}% %nl%" to console
set {_pcd-hoy} to convert date now to unix date
set {_pcd-hoy} to "%{_pcd-hoy}% seconds" parsed as timespan
send "%nl% Tiempo hoy: %{_pcd-hoy}% %nl%" to console
subtract {_pcd} from {_pcd-hoy}
send "%nl% tiempo restado: %{_pcd-hoy}% %nl%" to console
When performing the subtraction of {_pcd} and {_pcd-hoy}, it always results in 0.
Expected Behavior
The result should be the remaining time.
Steps to Reproduce
command /redem:
trigger:
set {_pcd} to skutil yaml value "cd.%{_tipo}%" of file "{@file}"
send "%nl% Tiempo guardado: %{_pcd}% %nl%" to console
set {_pcd} to "%{_pcd}% seconds" parsed as timespan
send "%nl% Tiempo convertido: %{_pcd}% %nl%" to console
set {_pcd-hoy} to convert date now to unix date
set {_pcd-hoy} to "%{_pcd-hoy}% seconds" parsed as timespan
send "%nl% Tiempo hoy: %{_pcd-hoy}% %nl%" to console
subtract {_pcd} from {_pcd-hoy}
send "%nl% tiempo restado: %{_pcd-hoy}% %nl%" to console
Errors or Screenshots
No response
Other
No response
Agreement
- I have read the guidelines above and affirm I am following them with this report.