Search:

Type: Posts; User: dave_nj

Search: Search took 0.19 seconds.

  1. Replies
    15
    Views
    1,409

    [SOLVED] Re: Issue with converting a string to a date

    Norm, aussiemcgr,

    Thanks for the help, especially the tip about toString! #:-s
    I should have mentioned the string the program was giving me in the OP, would have saved us some time haha.

    Dave
  2. Replies
    15
    Views
    1,409

    [SOLVED] Re: Issue with converting a string to a date

    Norm,

    The text of the error is the same as originally,
    required: Date
    found: java.util.Date

    doh is "Date"
  3. Replies
    15
    Views
    1,409

    [SOLVED] Re: Issue with converting a string to a date

    aussiemcgr,

    I actually added the
    Date(int m, int d, int y)
    {
    month = m;
    day = d;
    year = y;
    } to the Date class, it wasn't there before.
  4. Replies
    15
    Views
    1,409

    [SOLVED] Re: Issue with converting a string to a date

    java.util.Date convertedDate = DOB.parse(datestring);
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(convertedDate);
    this.doh = calendar.getTime();
    Same error.
  5. Replies
    15
    Views
    1,409

    [SOLVED] Re: Issue with converting a string to a date

    This is all it contains:

    public class Date
    {
    private int month;
    private int day;
    private int year;

    Date()
    {
  6. Replies
    15
    Views
    1,409

    [SOLVED] Re: Issue with converting a string to a date

    I feel like I should be the one asking this question!
  7. Replies
    15
    Views
    1,409

    [SOLVED] Re: Issue with converting a string to a date

    Hi Norm,

    I actually tried that but there are other lines which compare convertedDate to objects represented in the Date class, so they have to be compatible at some point.

    The program is...
  8. Replies
    15
    Views
    1,409

    [SOLVED] Issue with converting a string to a date

    I have this section:

    public void set_doh(int new_m, int new_d, int new_y)
    {
    String datestring = Integer.toString(new_m) + "/" + Integer.toString(new_d) + "/" + Integer.toString(new_y);...
Results 1 to 8 of 8