I have to save the date and time of booking in the database after the successful booking. I have tried like the following

成功预订后,我必须在数据库中保存预订的日期和时间。我尝试过如下

if(bookingSuccess){
DateTime bookingDate = new DateTime ();
storeDate(bookingDate );
} 


storeDate(DateTime date){

....

}

but it wont work if the server is in one location and the client is in another location. Please suggest any solution for this.

但如果服务器位于一个位置且客户端位于另一个位置,它将无法工作。请为此建议任何解决方案。

2 个解决方案

#1


0

run java script code on client side to get current time

在客户端运行java脚本代码以获取当前时间

var d = new Date();

while saving the booking entries , you can get the current time of user machine and save it in a variable. If booking is successful then save that time.

保存预订条目时,您可以获取用户计算机的当前时间并将其保存在变量中。如果预订成功,则保存该时间。

steps:

  • fetch booking details and current time of client
  • 获取预订详情和客户的当前时间

  • save booking
  • when booking is successful then save client time if server and client are on different locations
  • 预订成功后,如果服务器和客户端位于不同位置,则节省客户端时间

更多相关文章

  1. java时间转换,long , string和date和时间戳的互转
  2. java远程类加载与轻客户端
  3. Java时区转换与时间格式

随机推荐

  1. 在同一基准下对前端框架进行比较[每日前
  2. Scrapy对接Docker
  3. 付费代理的使用
  4. Android金额输入框只允许输入小数点后两
  5. 为什么你不应该成为一个“数据科学“通才
  6. 内网主机从外面连接不了?SSH反向隧道来帮
  7. Scrapy框架的使用之Spider的用法
  8. Scrapy框架的使用之Scrapy入门
  9. 记一次网络中断故障处理
  10. 【机器学习笔记】:大话线性回归(二)