• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Time format problem in java ?

 
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 21
Mac Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I feel that issue can be closed as very few experts in flex.

i have resolved the issue.

thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic