• Post Reply Bookmark Topic Watch Topic
  • New Topic

Time format problem in java ?  RSS feed

 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If user enters days date like 10/04/2011 then after saving the date users loses 1 day.
and getting date 09/04/2011.

This issue in for some specific Zone (US Users only).

what could be the problem , some Time -Zone issue, Local Issue in java or flex.


please suggest.
 
Markas Korotkovas
Greenhorn
Posts: 21
Eclipse IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to provide more details. It could be a lot of things just like you mentioned in you own post. For starters: how are you converting the String input to the Date? Are you converting the String? Is the date a String to begin with? and etc.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this month/day/year format, a.k.a. the US date format? If so, did you create the second string by getting the month from a Calendar object? If so, you should be aware that months in the Java Calendar system are 0 based; Calendar.JANUARY == 0.
 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the flex as front end.


then i am sending the date value in list together with other values.
myDate.text = ""+formatDate.format(tempCollection.myDate);

flex is then setting this value in actionScript file and finally it sent to java-DAOimpl layer to DB.
 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No format is

formatString="DD/MM/YYYY"


could you please give me example , that code can works for all the Zone without losing the days.

code should work as Global Client.
 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any update , one solution i found to use String datatype in flex(AS) /Java Bean and send the data as String in database.

Another solution to to set Time Offset which is independent of the location and Application or server.

please share if any one knows.
 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I feel that issue can be closed as very few experts in flex.

i have resolved the issue.

thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!