Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-10-28
5
Medium Priority
?
537 Views
Last Modified: 2008-01-09
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
Comment
Question by:pdlarue
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 37

Expert Comment

by:zzynx
ID: 12437185
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
 
LVL 37

Accepted Solution

by:
zzynx earned 2000 total points
ID: 12437223
Or do you mean this?

MPXDateFormat df = new MPXDateFormat();
df.applyPattern("dd/MM/yyyy");  // or the other pattern
MPXDate d = df.parse(theStringContainingTheDate);
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12437462
>> I need an answer as fast as possible.
Not that fast apparently ;°)
Sorry, going offline. Good luck.
0
 

Author Comment

by:pdlarue
ID: 12437962
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
 
LVL 37

Expert Comment

by:zzynx
ID: 12441737
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question