Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8025015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:01:50+00:00 2026-06-04T23:01:50+00:00

In a java class, i get the date as string say renewDate from the

  • 0

In a java class, i get the date as string say “renewDate” from the datepicker-input form in mm/dd/yyyy.

When i try to update in the code using joda time library

DateTime expireDate = new DateTime(renewDate);
// i get error at above line
updateOrganization.setRenewdate(expireDate.toDate());
organizationDAO.update(updateOrganization);

but if i format the date in the form i.e, from mm/dd/yyyy to yyyy-mm-dd and send it to the java class its working fine.

How can i format the date from mm/dd/yy to yyyy-mm-dd at Java class. Input is Stringformat.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T23:01:52+00:00Added an answer on June 4, 2026 at 11:01 pm

    The list of valid formats for the constructor you are using are detailed in the javadoc of ISODateTimeFormat, which does not include “mm/dd/yyyy”:

    datetime = time | date-opt-time
    time = ‘T’ time-element [offset]
    date-opt-time = date-element [‘T’ [time-element] [offset]]
    date-element = std-date-element | ord-date-element | week-date-element
    std-date-element = yyyy [‘-‘ MM [‘-‘ dd]]
    ord-date-element = yyyy [‘-‘ DDD]
    week-date-element = xxxx ‘-W’ ww [‘-‘ e]
    time-element = HH [minute-element] | [fraction]
    minute-element = ‘:’ mm [second-element] | [fraction]
    second-element = ‘:’ ss [fraction]
    fraction = (‘.’ | ‘,’) digit+
    offset = ‘Z’ | ((‘+’ | ‘-‘) HH [‘:’ mm [‘:’ ss [(‘.’ | ‘,’) SSS]]])

    You can parse a different format with a DateTimeFormatter (note MM in upper case for month):

    DateTimeFormatter fmt = DateTimeFormat.forPattern("MM/dd/yyyy");
    DateTime expireDate = fmt.parseDateTime(renewDate);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I've code like: import java.util.Date; import my.own.Date; class Test{ public static void main(String
i used java reflections to get methods from a class(loaded those classes).Now i want
I'm trying to get the date from a datepicker on a dialog. But it's
Here is my code to fetch and display date: import java.util.Calendar; public class Employee
How can I get an entity manager in a normal java class? I tried
With ANTLR, I get some java class files after compilation. And I need to
I get the Yahoo IP address using InetAddress class in java. The result of
i use java reflections to get methods used in a class.I also want to
My Java class contains the following methods: public static void main(String[] argv) //start the
Hi I want to get Time Zone from locale. My code is package com.my.country;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.