YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Formating Date Options
vsiva
#1 Posted : Wednesday, February 19, 2003 9:27:43 AM
Rank: Starting Member

Groups: Registered

Joined: 2/19/2003
Posts: 1
Location: ,
I am getting parse exception while I am trying to format the follwing date " 02:09:07 Jan 26, 2002 PST " using java.text.DateFormat class. It seems Paypal only return "payment_date" in this format . In my Java code I have that field as a Java.util.Date object. How do I convert that as Date object. Even I tried changing that field as String but I could not update in Database (MS SQLServer). Please somone guide me; how do I do that?. Thanks in Advance V Sivakumar
Sponsor  
 
paypal_pb
#2 Posted : Wednesday, February 19, 2003 4:26:10 PM
Rank: Starting Member

Groups: Registered

Joined: 9/16/2002
Posts: 2,960
Location: ,
I don't think it's a standard date format so you would need to parse it by hand.

Probably best to store it as a string.

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn
vinoth
#3 Posted : Thursday, February 20, 2003 2:53:39 AM
Rank: Starting Member

Groups: Registered

Joined: 1/9/2003
Posts: 6
Location: ,
Hope this helps

SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss MMM d, yyyy z");
Date date = sdf.parse("02:09:07 Jan 26, 2002 PST", new java.text.ParsePosition(0)));

Regards
vinoth
magnus
#4 Posted : Thursday, October 20, 2005 6:33:13 AM
Rank: Starting Member

Groups: Registered

Joined: 10/20/2005
Posts: 2
Location: ,
For us who use other language than English there could be problems with the month parsing. This solves the problem:

SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss MMM d, yyyy z", Locale.ENGLISH);
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.210 seconds.