Link to home
Start Free TrialLog in
Avatar of pdlarue
pdlarue

asked on

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
Avatar of zzynx
zzynx
Flag of Belgium image

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()
ASKER CERTIFIED SOLUTION
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> I need an answer as fast as possible.
Not that fast apparently ;°)
Sorry, going offline. Good luck.
Avatar of pdlarue
pdlarue

ASKER

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
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