简体   繁体   中英

Time lag between date send in object from client side [GWT] to server side [Spring ]

I have CellEditor where i want to edit date :

public interface Driver extends SimpleBeanEditorDriver<EditVO, ClassEditor> {
}

@UiField
DateBox date;

private final Driver driver;

@Inject
ClassEditor(Binder uiBinder,
              Driver driver) {
    this.driver = driver;


    initWidget(uiBinder.createAndBindUi(this));
    driver.initialize(this);

    DateTimeFormat dateFormat = DateTimeFormat.getFormat("dd/mm/yyyy);
    date.setFormat(new DateBox.DefaultFormat(dateFormat));
}

@Override
public void edit(DossierEditVO object) {
    driver.edit(object);
}

@Override
public EditVO get() {
    EditVO object = driver.flush();
    if (!driver.hasErrors()) {
        return object;
    }
    return null;
}

i have Date in class EditVO, in Controller i have :

 @RequestMapping(method = RequestMethod.PUT)
GetResult<Boolean> updateDossier(@RequestBody EditVO dossierEditVO) {
   //call service
   }

The problem that i have is when i select date that i want to edit for example : 11/10/2015, i get in client side with debug : Sun Oct 11 00:00:00 GMT+100 2015
and in server side i get : Sun Oct 10 23:00:00 UTC 2015. It's like a get a time tag of 2 hours between client side and server side. Any help please ?

If you don't specify a time zone, Java will use system time zone when printing dates. Your client and your server have different time zones.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM