File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Timezone problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Timezone problem" Watch "Timezone problem" New topic
Author

Timezone problem

pramodh somashekara
Ranch Hand

Joined: Jan 30, 2006
Posts: 62
hi, we have a web application running across different timezones in different countries. but we have a calculation which is sensitive to timezone from where user is trying to access the applications.
So how to implement this feature without affecting timezone of the user.

thanks in advance...
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

i can not get you from what your given statement but,

i can give you that how to calculate time according to the time zone
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Your question is quite vague and general, so it is hard to give you a specific answer. Keep the following in mind:

Class java.util.Date doesn't know anything about timezones. A Date object refers to a specific instance in time and is stored as the number of milliseconds since 1 January 1970, 12:00 AM UTC.

When you format a Date object for display using for example a java.text.SimpleDateFormat object, then you can set the timezone on the SimpleDateFormat object to determine in which time zone you want the date to be displayed.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
pramodh somashekara
Ranch Hand

Joined: Jan 30, 2006
Posts: 62
ok. let me give some more information - we have an online application running in Australia, US & europe. There is end of day operations which has to be run by USERS at the end of business hours i.e. 6 PM local time of each country and we have to restrict start of operation after 7 PM local time.
Considering that application is installed only in US, how to implement this scenario.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Originally posted by pramodh somashekara:
how to implement this scenario


get the current time according to the timezone . i given example above .. you need to know time zone key
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Timezone problem
 
Similar Threads
Handling different TimeZone
midlet datetime
Hadling TimeZone in applets
Permanent cookie
Handling different TimeZone in EJB