steve-community / steve

SteVe - OCPP server implementation in Java
GNU General Public License v3.0
728 stars 364 forks source link

Date handling in OCPP operations #1477

Open jerome-benoit opened 1 month ago

jerome-benoit commented 1 month ago

Checklist

Specifications

SteVe Version     : 3.6.0

Description

The date input in several forms for OCPP operations is not translated to the UTC in the payload. The OCPP server time stamping is already correctly using UTC. The charging station expects date in UTC after translation of the input date from the CSMS timezone to the charging station timezone. The timezone information is not expected to be part of it.

SetChargingProfile, ReserveNow and UpdateFirmware operations are impacted. The later is not possible since the input check for date in the future if you're running the CSMS on a GMT+X timezone.

goekay commented 1 month ago

if you're running the CSMS on a GMT+X timezone.

so, you are running steve not in the default (i.e. UTC) but some other timezone?

jerome-benoit commented 1 month ago

if you're running the CSMS on a GMT+X timezone.

so, you are running steve not in the default (i.e. UTC) but some other timezone?

The date inputs are always assuming the browser OS timezone while the server expects UTC dates. It can't work properly if the date inputs are not translated to UTC, which is not the case currently. Either the date inputs are documented to input UTC date (few work), either they are translated to UTC given the browser timezone, CSMS OS timezone and charging station configured timezone (a lot of work).

jerome-benoit commented 1 month ago

For now, I've commented out all @Future date validation in order to be able to input UTC dates in UTC+ timezone.

If it's considered as a reasonable solution for now, I can make a PR.