• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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: 22683
128
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
 
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic