Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes Removing Z/z and time from Calender date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Removing Z/z and time from Calender date" Watch "Removing Z/z and time from Calender date" New topic
Author

Removing Z/z and time from Calender date

reachsudha sudhakar
Greenhorn

Joined: May 04, 2011
Posts: 4
Hi,
I observe that in the Java Calender date when mapping from one calender date eleemnt to another calender date element I am getting calender date appending z or time at the end of the date value. I want to know how to truncate/remove the Z and time from calender date:

EX:

<NewArrival date="2011-05+01:00">
<NewArrival date = date="2011-01Z">

These red coloured needs to be removed from calender date.

Please explain how to do that to remove them from calender date.

Please give the reply soon, its urgent.

Thanks.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Hi reachsudha and welcome to the Ranch!

We like it if you BeForthrightWhenCrossPostingToOtherSites. Also, EaseUp!


luck, db
There are no new questions, but there may be new answers.
reachsudha sudhakar
Greenhorn

Joined: May 04, 2011
Posts: 4
Can some one please give a reply on this requirement please.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

Not very sure. But can't you use some standard java parsers to retrieve the values and then use String bases api's to remove the part.


Swastik
reachsudha sudhakar
Greenhorn

Joined: May 04, 2011
Posts: 4
Swastik Dey wrote:Not very sure. But can't you use some standard java parsers to retrieve the values and then use String bases api's to remove the part.


Not able to retrieve that date part alone from calder date or apply parse/dateformat methods on calender, if possible can you give an example as how we can do that..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Removing Z/z and time from Calender date
 
Similar Threads
how to convert gregoriancalendar obj to sqldate?
increasing the date in java as whole
java calneder example
Please guide me on writing the regex.
Extracting and Comparing Data