• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 547
  • Last Modified:

MPXJ - Can I change date format using the MPXJ object library? How?

Hi, experts:

I am successfully reading an MPP file using MPXJ.  However, date formats are sometimes returning dd/mm/yyyy and other times returning mm/dd/yyyy.  I can see the format in my Eclipse object browser but I'm having difficulty getting to it in my code.  Can anyone offer the code to get to the MPXDateFormat?

      MPXDateFormat df = new MPXDateFormat();    //MPXDateFormat cannot be resolved or is not a type

I'm giving this question high points because I need an answer as fast as possible.  I do apologize for the rediculous constant crisis mode that my management produces.  At least you don't have to work here.

Thanks in advance for your help,
Patricia
0
pdlarue
Asked:
pdlarue
  • 4
1 Solution
 
zzynxSoftware engineerCommented:
Are you talking about
     input: a String containing dd/mm/yyyy or mm/dd/yyyy
     output: a java.util.Date object

?
Then you need to use SimpleDateFormat and its function parse()
0
 
zzynxSoftware engineerCommented:
Or do you mean this?

MPXDateFormat df = new MPXDateFormat();
df.applyPattern("dd/MM/yyyy");  // or the other pattern
MPXDate d = df.parse(theStringContainingTheDate);
0
 
zzynxSoftware engineerCommented:
>> I need an answer as fast as possible.
Not that fast apparently ;°)
Sorry, going offline. Good luck.
0
 
pdlarueAuthor Commented:
Hey, zzynx:

Yes, after struggling with MPXDateFormat (couldn't figure out how to make it visible to me) I used the SimpleDateFormat in java.util.Date.  Now, I'm having trouble with the month being zero based (January comes back '00').  I'll figure it out soon.  If you haven't guessed yet, I'm not new to objects but I am new to Java.  I have to keep coming to you experts instead of researching it myself, because my manager is crazy.

Thanks again,
Patricia
0
 
zzynxSoftware engineerCommented:
Thanks

>> Now, I'm having trouble with the month being zero based (January comes back '00').
Indeed. Stupid design.
>> I have to keep coming to you experts instead of researching it myself,
No problem ;°)
>> because my manager is crazy.
Like most :°D
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now