I'm using the Joda DateTime object (per SO remendations) heavily on the Java back-end of my application. But I've not figured out a very consistent way to go back and forth to JavaScript. The Date object described by MDN seems to indicate that "IETF-pliant RFC 1123 timestamps" are a standard format, but my searches didn't seem to turn up a formatter built into the Joda library to get my DateTime object in that format.
Is there a simple method I can invoke to convert a DateTime object to a format consumable by my web-client? Will it support IE8 (in terms of JavaScript)?
*Note: I'm not using Spring or anything that does automatic binding (serialization/deserialization) and it's not an option at this point. I know, I know...
I'm using the Joda DateTime object (per SO remendations) heavily on the Java back-end of my application. But I've not figured out a very consistent way to go back and forth to JavaScript. The Date object described by MDN seems to indicate that "IETF-pliant RFC 1123 timestamps" are a standard format, but my searches didn't seem to turn up a formatter built into the Joda library to get my DateTime object in that format.
Is there a simple method I can invoke to convert a DateTime object to a format consumable by my web-client? Will it support IE8 (in terms of JavaScript)?
*Note: I'm not using Spring or anything that does automatic binding (serialization/deserialization) and it's not an option at this point. I know, I know...
Share Improve this question edited Oct 7, 2021 at 5:51 CommunityBot 11 silver badge asked Sep 19, 2011 at 13:07 blongblong 2,7038 gold badges47 silver badges114 bronze badges 01 Answer
Reset to default 6The easiest solution is to use the miliseconds since epoch version of the javascript Date
constructor. For the conversion you can use DateTimeUtils.getInstantMillis(ReadableInstant instant)
.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745347530a4623628.html
评论列表(0条)