如何将日期作为 URL 参数传递 [英] How to pass the date as URL parameter

查看:70
本文介绍了如何将日期作为 URL 参数传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Titan 通过网络服务为特定的网络应用程序创建一些应用程序.

I am using the titanium to create some app for a particular web application through a webservice.

这里我将日期作为 URL 参数传递给 java 中调用特定的 webservice 方法.日期格式如下

Here I am passing the date as a URL parameter to call a particular webservice method in java.And the date format is as like below

2015-02-04T05:10:58+05:30

在java服务方法中,期望参数类型为Date.So如何通过URL参数发送上述日期格式.

In java service method the expecting parameter type as Date.So how can i send the above format of date through URL Parameter.

推荐答案

您可以使用 encodeURIComponent javascript 函数.

You can encode the time string using the encodeURIComponent javascript function.

encodeURIComponent("2015-02-04T05:10:58+05:30");

结果...

2015-02-04T05%3A10%3A58%2B05%3A30

这篇关于如何将日期作为 URL 参数传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆